0% found this document useful (0 votes)
5 views229 pages

Computer Networking (Complete Note)

The document provides an overview of computer networking, detailing its infrastructure, components, and various topologies. It explains data communication characteristics, types of network devices, and applications in business and home settings. Additionally, it describes different network topologies including bus, star, ring, and tree, along with their advantages and disadvantages.

Uploaded by

youbrajkadel777
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views229 pages

Computer Networking (Complete Note)

The document provides an overview of computer networking, detailing its infrastructure, components, and various topologies. It explains data communication characteristics, types of network devices, and applications in business and home settings. Additionally, it describes different network topologies including bus, star, ring, and tree, along with their advantages and disadvantages.

Uploaded by

youbrajkadel777
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Networking

Soba Raj Paudel


Unit-1
Introduction
A computer network is a group of computer systems and other computing hardware devices
that are linked together through communication channels to facilitate communication and
resource-sharing among a wide range of users.

Figure: Computer network

Network as an infrastructure for Data Communication


 Network infrastructure is the hardware and software resources of an entire network that
enable network connectivity, communication, operations and management of an enterprise
network.
 It provides the communication path and services between users, processes, applications,
services and external networks/the internet.
Network infrastructure is typically part of the IT infrastructure found in most enterprise IT
environments. The entire network infrastructure is interconnected, and can be used for internal
communications, external communications or both.

1
A typical network infrastructure includes:

Networking Hardware: Networking Software:


• Routers • Network operations and
• Switches management
• LAN cards • Operating systems
• Wireless routers • Firewall
• Cables • Network security applications
Network Services:
• Satellite
• Wireless protocols
• IP addressing

Data communications are the exchange of data between two devices via some form of
transmission medium such as a wire cable. For data communications to occur, the
communicating devices must be part of a communication system made up of a combination of
hardware (physical equipment) and software (programs).

The effectiveness of a data communications system depends on four fundamental


characteristics: delivery, accuracy, timeliness, and jitter.

1. Delivery: The system must deliver data to the correct destination. Data must be
received by the intended device or user and only by that device or user.

2. Accuracy: The system must deliver the data accurately. Data that have been altered in
transmission and left uncorrected are unusable.

3. Timeliness: The system must deliver data in a timely manner.

4. Jitter: Jitter refers to the variation in the packet arrival time. It is the uneven delay in
the delivery of audio or video packets. For example, let us assume that video packets are
sent every 30 milliseconds. If some of the packets arrive with 30-ms delay and others with
40-ms delay, an uneven quality in the video is the result.

Data Communication Components


A data communications system has five components:
1. Message
2. Sender
3. Receiver
4. Protocol
5. Medium

2
1. Message. The message is the information (data) to be communicated. Popular forms of
information include text, numbers, pictures, audio, and video.
2. Sender. The sender is the device that sends the data message. It can be a computer,
workstation, telephone handset, video camera, and so on.
3. Receiver. The receiver is the device that receives the message. It can be a computer,
workstation, telephone handset, television, and so on.
4. Transmission medium. The transmission medium is the physical path by which a message
travels from sender to receiver. Some examples of transmission media include twisted-pair
wire, coaxial cable, fiberoptic cable, and radio waves.
5. Protocol. A protocol is a set of rules that governs data communications. It represents an
agreement between the communicating devices. Without a protocol, two devices may be
connected but not communicating.

Direction of Data Flow


Communication between two devices i.e. sender & receiver can be of three types:
1. Simplex,
2. Half-duplex, or
3. Full-duplex
1. Simplex
 In simplex mode, the communication is unidirectional, as on a one-way street.
 Only one of the two devices on a link can transmit; the other can only receive.
 Keyboards and traditional monitors are examples of simplex devices.
 The keyboard can only introduce input; the monitor can only accept output.
 The simplex mode can use the entire capacity of the channel to send data in one
direction.

2. Half duplex
 In half-duplex mode, each station can both transmit and receive, but not at the same
time.
 When one device is sending, the other can only receive, and vice versa.
 In a half-duplex transmission, the entire capacity of a channel is taken over by
whichever of the two devices is transmitting at the time.
 Walkie-talkies and CB (citizens band) radios are both half-duplex systems.
 The half-duplex mode is used in cases where there is no need for communication in
both directions at the same time; the entire capacity of the channel can be utilized for
each direction.

3
3. Full duplex
 In full-duplex mode (also, called duplex), both stations can transmit and receive
simultaneously.
 In full-duplex mode, signals going in one direction share the capacity of the link with
signals going in the other direction.
 This sharing can occur in two ways: Either the link must contain two physically
separate transmission paths, one for sending and the other for receiving; or the capacity
of the channel is divided between signals travelling in both directions.
 One common example of full-duplex communication is the telephone network.

Applications of Computer Network


Major applications areas of computer networks are:
1. Business Applications
Following are some business applications of computer networks:
a. Resource Sharing:

The goal is to make all programs, equipments (like printers etc), and especially data, available
to anyone on the network without regard to the physical location of the resource and the user.

b. Server-Client model:

One can imagine a company's information system as consisting of one or more databases and
some employees who need to access it remotely. In this model, the data is stored on powerful
computers called Servers. Often these are centrally housed and maintained by a system
administrator. In contrast, the employees have simple machines, called Clients, on their desks,
using which they access remote data

c. Communication Medium:

A computer network can provide a powerful communication medium among employees.


Virtually every company that has two or more computers now has e-mail (electronic mail),
which employees generally use for a great deal of daily communication

d. E-Commerce:

A goal that is starting to become more important in businesses is doing business with
consumers over the Internet. Airlines, bookstores and music vendors have discovered that
many customers like the convenience of shopping from home. This sector is expected to grow
quickly in the future.

The most popular forms are listed in the below figure:

4
2. Home Application
Some of the most important uses of the Internet for home users are as follows:

a. Access to remote information

b. Person-to-person communication

c. Interactive entertainment

d. Electronic commerce

3. Mobile users
Mobile computers, such as notebook computers and Mobile phones, is one of the fastest-
growing segment of the entire computer industry.

Network Devices
1. Repeater – A repeater operates at the physical layer. Its job is to regenerate the
signal over the same network before the signal becomes too weak or corrupted so
as to extend the length to which the signal can be transmitted over the same network.
An important point to be noted about repeaters is that they do not amplify the signal.
When the signal becomes weak, they copy the signal bit by bit and regenerate it at
the original strength. It is a 2 port device.

2. Hub – A hub is basically a multiport repeater. A hub connects multiple wires


coming from different branches, for example, the connector in star topology which
connects different stations. Hubs cannot filter data, so data packets are sent to all
connected devices. In other words, collision domain of all hosts connected through
Hub remains one. Also, they do not have intelligence to find out best path for data
packets which leads to inefficiencies and wastage.

5
Types of Hub
 Active Hub:- These are the hubs which have their own power supply and
can clean , boost and relay the signal along the network. It serves both as a
repeater as well as wiring center. These are used to extend maximum
distance between nodes.
 Passive Hub:- These are the hubs which collect wiring from nodes and
power supply from active hub. These hubs relay signals onto the network
without cleaning and boosting them and can’t be used to extend distance
between nodes.
3. Bridge – A bridge operates at data link layer. A bridge is a repeater, with add on
functionality of filtering content by reading the MAC addresses of source and
destination. It is also used for interconnecting two LANs working on the same
protocol. It has a single input and single output port, thus making it a 2 port device.

Types of Bridges
Transparent Bridges :- These are the bridge in which the stations are
completely unaware of the
bridge’s existence i.e. whether or not a bridge is added or deleted from the
network , reconfiguration of
the stations is unnecessary. These bridges makes use of two processes i.e.
bridge forwarding and bridge learning.
Source Routing Bridges :- In these bridges, routing operation is performed
by source station and the frame specifies which route to follow. The hot can
discover frame by sending a special frame called discovery frame, which
spreads through the entire network using all possible paths to destination.
4. Switch – A switch is a multi-port bridge with a buffer and a design that can boost
its efficiency (large number of ports imply less traffic) and performance. Switch is
data link layer device. Switch can perform error checking before forwarding data
that makes it very efficient as it does not forward packets that have errors and
forward good packets selectively to correct port only. In other words, switch
divides collision domain of hosts, but broadcast domain remains same.

6
5. Routers – A router is a device like a switch that routes data packets based on their
IP addresses. Router is mainly a Network Layer device. Routers normally connect
LANs and WANs together and have a dynamically updating routing table based on
which they make decisions on routing the data packets. Router divide broadcast
domains of hosts connected through it.

6. Gateway – A gateway, as the name suggests, is a passage to connect two networks


together that may work upon different networking models. They basically works as
the messenger agents that take data from one system, interpret it, and transfer it to
another system. Gateways are also called protocol converters and can operate at any
network layer. Gateways are generally more complex than switch or router.

7. Brouter – It is also known as bridging router is a device which combines features


of both bridge and router. It can work either at data link layer or at network layer.
Working as router, it is capable of routing packets across networks and working as
bridge, it is capable of filtering local area network traffic.

8. Network Interface Card- A network interface (or NIC card ) is a printed circuit
board that fits into the expansion slot on the motherboard of a computer or on the
peripheral device to the network device to the network through the hub or switch.
These days, network cards are integrated within the mother board. These types of
integrated cards are called in network interface cards.
Network interface cards work on layer 2 of the OSI model. The network interface
cards are identified with the MAC address. The MAC address of a NIC card is
globally unique. The MAC address contains manufacturer ID and NIC card ID.

7
Network Topology
Topology refers to the shape of a network, or the network’s layout. How different nodes in a
network are connected to each other and how they communicate with each other is determined
by the network's topology. Topologies are either physical or logical.
Some of the most common network topologies are:
• Bus topology
• Star topology
• Ring topology
• Tree topology
• Mesh topology
• Cellular topology.
The parameters that are to be considered while selecting a physical topology are:
• Ease of installation.
• Ease of reconfiguration.
• Ease of troubleshooting.

1. Bus Topology
In Bus topology, all devices are connected to a central cable, called the bus or backbone. The
bus topology connects workstations using a single cable. Each workstation is connected to the
next workstation in a point-to-point fashion. All workstations connect to the same cable. Figure
shows computers connected using Bus Topology.
In this type of topology, if one workstation goes faulty all workstations may be affected as all
workstations share the same cable for the sending and receiving of information. The cabling
cost of bus systems is the least of all the different topologies. Each end of the cable is
terminated using a special terminator.
The common implementation of this topology is Ethernet. Here, message transmitted by one
workstation is heard by all the other workstations.

Fig: Bus Topology

8
Advantages of Bus Topology
• Installation is easy and cheap when compared to other topologies.
• Connections are simple and this topology is easy to use.
• Less cabling is required.
Disadvantages of Bus Topology
• Used only in comparatively small networks.
• As all computers share the same bus, the performance of the network deteriorates when
we increase the number of computers beyond a certain limit.
• Fault identification is difficult.
• A single fault in the cable stops all transmission.

2. Star Topology
Star topology uses a central hub through which, all components are connected. In a Star
topology, the central hub is the host computer, and at the end of each connection is a terminal
as shown in Nodes communicate across the network by passing data through the hub. A star
network uses a significant amount of cable as each terminal is wired back to the central hub,
even if two terminals are side by side but several hundred meters away from the host. The
central hub makes all routing decisions, and all other workstations can be simple.

Figure: Star Topology


An advantage of the star topology is, that failure, in one of the terminals does not affect any
other terminal; however, failure of the central hub affects all terminals. This type of topology
is frequently used to connect terminals to a large time-sharing host computer.
Advantages of star topology
• Installation and configuration of network is easy.
• Less expensive when compared to mesh topology.
• Faults in the network can be easily traced.
• Expansion and modification of star network is easy.
• Single computer failure does not affect the network.
• Supports multiple cable types like shielded twisted pair cable, unshielded twisted pair
cable, ordinary telephone cable etc.
Disadvantages of Bus Topology
• Failure in the central hub brings the entire network to a halt.
• More cabling is required in comparison to tree or bus topology because each node is
connected to the central hub.

3. Ring Topology
In Ring Topology all devices are connected to one another in the shape of a closed loop, so
that each device is connected directly to two other devices, one on either side of it, i.e., the ring
topology connects workstations in a closed loop, which is depicted in Figure. Each terminal is

9
connected to two other terminals (the next and the previous), with the last terminal being
connected to the first. Data is transmitted around the ring in one direction only; each station
passing on the data to the next station till it reaches its destination.
Information travels around the ring from one workstation to the next. Each packet of data sent
on the ring is prefixed by the address of the station to which it is being sent. When a packet of
data arrives, the workstation checks to see if the packet address is the same as its own, if it is,
it grabs the data in the packet. If the packet does not belong to it, it sends the packet to the next
workstation in the ring.

Figure: Ring Topology


Faulty workstations can be isolated from the ring. When the workstation is powered on, it
connects itself to the ring. When power is off, it disconnects itself from the ring and allows the
information to bypass the workstation.
The common implementation of this topology is token ring. A break in the ring causes the
entire network to fail. Individual workstations can be isolated from the ring.
Advantages of ring topology
• Easy to install and modify the network.
• Fault isolation is simplified.
• Unlike Bus topology, there is no signal loss in Ring topology because the tokens are
data packets that are re-generated at each node.

Disadvantages of ring topology


• Adding or removing computers disrupts the entire network.
• A break in the ring can stop the transmission in the entire network.
• Finding fault is difficult.
• Expensive when compared to other topologies.

4. Tree Topology
Tree topology is a LAN topology in which only one route exists between any two nodes on the
network. The pattern of connection resembles a tree in which all branches spring from one root.
Figure shows computers connected using Tree Topology.

10
Figure: Tree topology
Tree topology is a hybrid topology, it is similar to the star topology but the nodes are connected
to the secondary hub, which in turn is connected to the central hub. In this t opology groups of
star-configured networks are connected to a linear bus backbone.
Advantages of Tree Topology
• Installation and configuration of network is easy.
• Less expensive when compared to mesh topology.
• Faults in the network can be detected traced.
• The addition of the secondary hub allows more devices to be attached to the central
hub.
• Supports multiple cable types like shielded twisted pair cable, unshielded twisted pair
cable, ordinary telephone cable etc.
Disadvantages of Tree Topology
• Failure in the central hub brings the entire network to a halt.
• More cabling is required when compared to bus topology because each node is
connected to the central hub.

5. Mesh Topology
Devices are connected with many redundant interconnections between network nodes. In a
well-connected topology, every node has a connection to every other node in the network. The
cable requirements are high, but there are redundant paths built in. Failure in one of the
computers does not cause the network to break down, as they have alternative paths to other
computers.

Figure: Mesh Topology


Mesh topologies are used in critical connection of host computers (typically telephone
exchanges). Alternate paths allow each computer to balance the load to other computer systems
in the network by using more than one of the connection paths available. A fully connected
mesh network therefore has n (n-1)/2 physical channels to link n devices. To accommodate
these, every device on the network must have (n-1) input/output ports.
11
Advantages of Mesh Topology
• Use of dedicated links eliminates traffic problems.
• Failure in one of the computers does not affect the entire network.
• Point-to-point link makes fault isolation easy.
• It is robust.
• Privacy between computers is maintained as messages travel along dedicated path.
Disadvantages of Mesh Topology
• The amount of cabling required is high.
• A large number of I/O (input/output) ports are required.

6. Cellular Topology

Figure: Cellular topology

Cellular topology, divides the area being serviced into cells. In wireless media each point
transmits in a certain geographical area called a cell, each cell represents a portion of the total
network area. Figureshows computers using Cellular Topology. Devices that are present within
the cell, communicate through a central hub. Hubs in different cells are interconnected and
hubs are responsible for routing data across the network. They provide a complete network
infrastructure.
Cellular topology is applicable only in case of wireless media that does not require cable
connection.

Advantages of Cellular Topology


• If the hubs maintain a point-to-point link with devices, trouble shooting is easy.
• Hub-to-hub fault tracking is more complicated, but allows simple fault isolation.

Disadvantages of Cellular Topology


• When a hub fails, all devices serviced by the hub lose service (are affected).

Network Architecture
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. Architecture also defines
how the computers should get connected to get the maximum advantages of a computer
network such as better response time, security, scalability etc.
Two types of network architecture are:
1. Client/Server Architecture
2. Peer to Peer Architecture

12
1. Client/Server Architecture

Figure: Client/Server Architecture

Client/Server Architecture is one in which the client (personal computer or workstation) is the
requesting machine and the server is the supplying machine, both of which are connected via
a local area network (LAN) or wide area network (WAN). The client/server architecture
significantly decreased network traffic by providing a query response rather than total file
transfer. It allows multi-user updating through a GUI front end to a shared database. Remote
Procedure Calls (RPCs) or standard query language (SQL) statements are typically used to
communicate between the client and server.
The following are the examples of client/server architectures.

1) Two tier architectures A two-tier architecture is where a client talks directly to a server,
with no intervening server. It is typically used in small environments (less than 50 users). In
two tier client/server architectures, the user interface is placed at user's desktop environment
and the database management system services are usually in a server that is a more powerful
machine that provides services to the many clients. Information processing is split between the
user system interface environment and the database management server environment.
2) Three tier architectures The three tier architecture is introduced to overcome the
drawbacks of the two tier architecture. In the three tier architecture, a middleware is used
between the user system interface client environment and the database management server
environment.
These middleware are implemented in a variety of ways such as transaction processing
monitors, message servers or application servers. The middleware perform the function of
queuing, application execution and database staging. In addition the middleware adds
scheduling and prioritization for work in progress.
The three tier client/server architecture is used to improve performance for large number of
users and also improves flexibility when compared to the two tier approach.
The drawback of three tier architectures is that the development environment is more difficult
to use than the development of two tier applications.
The widespread use of the term 3-tier architecture also denotes the following architectures:
• Application sharing between a client, middleware and enterprise server.
• Application sharing between a client, application server and enterprise database server.
i) Three tier with message server: In this architecture, messages are processed and prioritized
asynchronously. Messages have headers that include priority information, address and

13
identification number. The message server links to the relational DBMS and other data sources.
Messaging systems are alternative for wireless infrastructures.
ii) Three tier with an application server: This architecture allows the main body of an
application to run on a shared host rather than in the user system interface client environment.
The application server shares business logic, computations and a data retrieval engine. In this
architecture applications are more scalable and installation costs are less on a single server than
maintaining each on a desktop client.
3-tier architecture provides
• A greater degree of flexibility
• Increased security, as security can be defined for each service, and at each level
• Increased performance, as tasks are shared between servers
The basic characteristics of client/server architectures are:
1) Combination of a client or front-end portion that interacts with the user, and a server
or back-end portion that interacts with the shared resource. The client process
contains solution-specific logic and provides the interface between the user and the rest of the
application system. The server process acts as a software engine that manages shared
resources such as databases, printers, modems, or high powered processors.
2) The front-end task and back-end task have fundamentally different requirements for
computing resources such as processor speeds, memory, disk speeds and capacities, and
input/output devices.
3) The environment is typically heterogeneous and multivendor. The hardware platform
and operating system of client and server are not usually the same. Client and server processes
communicate through a well-defined set of standard application program interfaces (API's) and
RPC's.
4) An important characteristic of client-server systems is scalability. They can be scaled
horizontally or vertically. Horizontal scaling means adding or removing client workstations
with only a slight performance impact. Vertical scaling means migrating to a larger and faster
server machine or multiservers.

Advantages of Client/Server Architecture

 Improved Data Sharing: Data is retained by usual business processes and manipulated
on a server is available for designated users (clients) over an authorized access.

 Integration of Services: Every client is given the opportunity to access corporate


information via desktop interface eliminating the necessity to log into a terminal mode
or processor.

 Shared Resources Amongst Different Platforms: Application used for client-server


model is built regardless of the hardware platform or technical background of the
entitled software (operating system software) providing an open computing
environment, enforcing users to obtain the services of clients and servers (database,
application and communication services)

 Data Processing Capability Despite the Location: Client-server users can directly log
into a system despite of the location or technology of the processors.

14
 Easy Maintenance: Client-server architecture is distributed model representing
dispersed responsibilities among independent computers integrated across a network.
Therefore, it's easy to replace, repair, upgrade and relocate a server while client remains
unaffected. This unaware change is called as Encapsulation.

 Security: Servers have better control access and resources to ensure that only authorized
clients can access or manipulate data and server updates are administered effectively.

Disadvantages of Client/Server Architecture

 Overloaded Servers: When there are frequent simultaneous client requests, server
severely get overloaded, forming traffic congestion.

 Impact of Centralized Architecture: Since it is centralized, if a critical server failed,


client requests are not accomplished. Therefore, client-server lacks the robustness of a
good network.

2. Peer-to Peer Architecture

Figure: Peer-to-Peer Architecture


A type of network in which each workstation has equal capabilities and responsibilities is called
peer-to-peer network. Figure shows the arrangement of computers in a peer-to-peer
environment. Here each workstation acts as both a client and a server. There is no central
repository for information and there is no central server to maintain. Data and resources are
distributed throughout the network, and each user is responsible for sharing data and resources
connected to their system. This differs from client/server architectures, in which some
computers are dedicated to serving the others. Peer-to-peer networks are generally simpler and
less expensive, but they usually do not offer the same performance under heavy loads. A peer-
to-peer network is also known as a Distributed network.

Advantages of Peer-to-Peer Architecture


1. Networks are easy to set up and maintain as each computer manages itself.
2. It eliminates extra cost required in setting up the server.
3. Since each device is master of its own, they are not dependent on other computers for
their operations.

Disadvantages of Peer-to-Peer Architecture


1. In peer-to-peer network, the absence of centralized server makes it difficult to backup
data as data is located on different workstations.
2. Security is weak as each system manages itself only.

15
3. There is no central point of data storage for file archiving.

Difference between Client/Server and Peer-to-Peer Architecture

BASIS FOR
CLIENT-SERVER PEER-TO-PEER
COMAPAISON

Basic There is a specific server and Clients and server are not
specific clients connected to the distinguished; each node act as client
server. and server.

Service The client request for service and Each node can request for services
server respond with the service. and can also provide the services.

Focus Sharing the information. Connectivity.

Data The data is stored in a centralized Each peer has its own data.
server.

Server When several clients request for As the services are provided by
the services simultaneously, a several servers distributed in the
server can get bottlenecked. peer-to-peer system, a server in not
bottlenecked.

Expense The client-server are expensive Peer-to-peer are less expensive to


to implement. implement.

Stability Client-Server is more stable and Peer-to-Peer suffers if the number of


scalable. peers increases in the system.

Types of Computer Networks


Computer Networks are mostly classified on the basis of the geographical area that the network
covers, the topology used, the transmission media used and the computing model used.
Based on the geographical area covered the networks may be LAN, MAN, WAN, GAN, PAN.

1. Local Area Network (LAN)

LAN or Local Area Network links network devices in such a way that personal computer and
workstations can share data, tools and programs. Data transmits at a very fast rate as the number
of computers linked are limited. LAN’s cover a smaller geographical area and are privately
owned. One can use it for an office building, home, hospital, schools, etc. LAN is easy to design
and maintain.
If more than two computers are to be connected in one LAN, additional network components
such as hubs, bridges, and switches are needed, which act as coupling elements and distribution

16
nodes. The network type LAN was developed to enable fast transmission of large amounts
of data.
LANs enable convenient information exchange between the various devices connected to the
network. In a business context, it’s common to share files, network printers, and applications
via LAN with several computers.

Figure: Local Area Network


If a local network is implemented via radio, it is referred to as a Wireless Local Area Network
(WLAN). The WLAN standard’s technical basis is defined by the IEEE 802.11 family of
standards. Wireless local networks offer the ability to easily integrate devices into home or
corporate networks, and are compatible with wired Ethernet LANs. However, the data
throughput is lower than for an Ethernet connection.
A Communication medium used for LAN has twisted pair cables and coaxial cables. It covers
a short distance, and so the error and noise are minimized. LAN can be configured in the ring,
bus and star topology. The ring topology is prevalent in the Token Ring LANs of IBM and bus
is widespread in Token Bus and Ethernet LANs.
LANs are capable of transmitting data at very fast rates, much faster than data can be
transmitted over a telephone line; but the distances are limited, and there is also a limit on the
number of computers that can be attached to a single LAN.
The typical characteristics of a LAN are:
• Confined to small areas i.e., it connects several devices over a distance of 5 to 10 km.
• High speed.
• Most inexpensive equipment.
• Low error rates.
• Data and hardware sharing between users owned by the user.
• Operates at speeds ranging from 10Mbps to 100Mbps. Now a days 1000 Mbps are
available.

2. Metropolitan Area Network (MAN)

Metropolitan Area Network is a Computer network designed for a town or city. In terms of
geographic area MAN’s are larger than local-area networks (LANs), but smaller than wide-
area networks (WANs). MAN’s are usually characterized by very high-speed connections
using fiber optical cable or other digital media. The best known example of a MAN is the cable
television network available in many cities. A standard for larger regional radio networks,
known as Wireless Metropolitan Area Networks (WMAN), was developed with IEEE
802.16. This technology known as WiMAX (Worldwide Interoperability for Microwave

17
Access) makes it possible to set up WiFi hotspots. These are several WiFi access points
working together in different locations.

Figure: Metropolitan Area Network


The Typical Characteristics of a MAN are:
• Confined to a larger area than a LAN and can range from 10km to a few 100km in
length.
• Slower than a LAN but faster than a WAN.
• Operates at a speed of 1.5 to 150 Mbps.
• Expensive equipment.
• Moderate error rates

3. Wide Area Network (WAN)

Wide Area Network is a computer network that spans a relatively large geographical area.
Typically, a WAN consists of two or more local area networks (LANs), which are depicted, in
Figure. They can connect networks across cities, states or even countries.

Figure: wide area network


Computers connected to a wide-area network are often connected through public networks,
such as the telephone system. They can also be connected through leased lines or satellites.
The Typical characteristics of a WAN are:
• A WAN can range from 100km to 1000km and the speed is less than 150 Mbps.
• WAN supports large number of computers and multiple host machines.

18
• Various segments of network are interconnected using sophisticated support devices
like routers and gateways.
• Usually the speed is much slower than LAN speed.
• Highest possible error rate compared to LAN & MAN.

4. Global Area Network (GAN)

A global network, such as the internet, is referred to as the Globe Area Network (GAN). The
internet is, however, not the only computer network of its kind. Internationally operating
companies also support local networks that comprise of several WANs and connect company
computers across the world. GANs use the fiber optic infrastructure from wide area networks
and combine these with international undersea cables or satellite transmissions.
5. Personal Area Network (PAN)
To enable data exchange, modern devices such as smartphones, tablets, laptops, and desktop
computers can be integrated into a network. This can be wired in the form of a Personal Area
Network (PAN). Common transfer techniques include USB or FireWire. The wireless variety
is known as Wireless Personal Area Network (WPAN) and is based on technologies such as
Bluetooth, Wireless USB. A wireless Personal Area Network, which can be achieved via
Bluetooth, is called Piconet. PANs and WPANs usually only stretch over a few meters, and
are therefore not suitable for connecting devices in different rooms or even buildings. Due to
the limited range and a comparatively low data transfer rate, PANs are primarily used to
connect peripheral devices in the hobby and entertainment sector. Typical examples include
wireless headphones, game consoles, and digital cameras. Within the Internet of Things
(IoT)’s framework, WPANs are responsible for the communication of control and monitoring
applications with a low data rates. Protocols such as Insteon, Z-Wave, and ZigBee have been
specifically designed for smart homes and home automation.

Figure: Personal Area Network

19
Difference between LAN, MAN and WAN

BASIS OF
LAN MAN WAN
COMPARISON

Stands For Local Area Metropolitan Area Wide Area Network


Network Network

Definition LAN (Local Area A metropolitan area WAN (Wide Area Network)
Network) is a network (MAN) is a is a computer network that
computer network network with a size covers a broad area (e.g.,
covering a small between a LAN and any network whose
geographic area, a WAN. It normally communications links cross
like a home, office, covers the area metropolitan, regional, or
school, or group of inside a town or a national boundaries over a
buildings. city. long distance).

Covers Local areas only Covers the area Large geographic areas (e.g.,
(e.g., homes, inside a town or a cities, states, nations)
offices, schools) city.

Ownership of Private Private or Public Private or Public


Network

Speed High speed (1000 moderate speed(44 to Less speed (150 Mbps)
Mbps) 150 Mbps)

Maintenance Easy Difficult Difficult

Propagation Short Moderate Long


Delay

Tolerance LANs tend to have Less fault tolerance WANs tend to be less fault
fewer problems tolerant as they consist of a
associated with large number of systems.
them, as there is a
smaller number of
systems to deal
with.

Bandwidth High bandwidth Less bandwidth Low bandwidth

Congestion Less congestion More congestion More congestion

Example College, School, The network in city The Internet is a good


Hospital. building can be a example of a WAN
MAN

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

Standards
Standards are mainly used to provide guidelines to manufacturers, vendors, government
agencies, and also to other service providers in order to ensure the kind of interconnectivity
that is necessary for today's marketplace and also in international communications.
Data communication standards mainly fall into two categories:-

 de facto (which means "by fact"/ "by convention") Those standards have not been
approved by an organized body but have been adopted as standards through widespread
use. These types of standards are often established originally by the manufacturers who
just seek to define the functionality of their new product or technology.
 de jure (which means "by law" /"by regulation") de jure standards are those standards
that have been legislated by an officially recognized body.

Standard Organizations

Standards are mainly developed through the cooperation of Standard creation committees,
government regulatory agencies, and forums.

Some Standard Creation committees are:

 International Organization for Standardization (ISO): The ISO is a multinational body whose
membership is drawn mainly from the standards creation committees of various governments
throughout the world. The ISO is active in developing cooperation in the fields of scientific,
technological, and economic activity.
 International Telecommunication Union-Telecommunication Standards Sector (ITU-T): This
committee was devoted to the research and establishment of standards for telecommunications in
general and for phone and data systems in particular.

21
 American National Standards Institute (ANSI): Despite its name, the American National
Standards Institute is a completely private, non-profit corporation not affiliated with the U.S. federal
government. However, all ANSI activities are undertaken with the welfare of the United States and
its citizens occupying primary importance.
 Institute of Electrical and Electronics Engineers (IEEE): It is the largest professional
engineering society in the world. International in scope, it aims to advance theory, creativity, and
product quality in the fields of electrical engineering, electronics, and radio as well as in all related
branches of engineering. As one of its goals, the IEEE oversees the development and adoption of
international standards for computing and communications.
 Electronic Industries Association (EIA): Aligned with ANSI, It is a non-profit organization
devoted to the promotion of electronics manufacturing concerns. Its activities include public
awareness education and efforts in addition to standards development. In the field of information
technology, the EIA has made significant contributions by defining physical connection interfaces
and electronic signalling specifications for data communication.

OSI Reference Model

The Open System Interconnection (OSI) model is a set of protocols that attempt to define and
standardize the data communications process; we can say that it is a concept that describes how
data communications should take place.
The OSI model was set by the International Standards Organisation (ISO) in 1984, and it is
now considered the primary architectural model for inter-computer communications. The OSI
model has the support of most major computer and network vendors, many large customers,
and most governments in different countries.
The Open Systems Interconnection (OSI) reference model describes how information from a
software application in one computer moves through a network medium to a software
application in another computer. The OSI reference model is a conceptual model composed of
seven layers as shown in Figure each specifying particular network functions and into these
layers are fitted the protocol standards developed by the ISO and other standards bodies. The
OSI model divides the tasks involved with moving information between networked computers
into seven smaller, more manageable task groups. A task or group of tasks is then assigned to
each of the seven OSI layers. Each layer is reasonably self-contained so that the tasks assigned
to each layer can be implemented independently. This enables the solutions offered by one
layer to be updated without affecting the other layers.
The OSI model is modular. Each successive layer of the OSI model works with the one above
and below it.
Although, each layer of the OSI model provides its own set of functions, it is possible to group
the layers into two distinct categories. The first four layers i.e., physical, data link, network,
and transport layer provide the end-to-end services necessary for the transfer of data between
two systems. These layers provide the protocols associated with the communications network
used to link two computers together. Together, these are communication oriented.
The top three layers i.e., the application, presentation, and session layers provide the
application services required for the exchange of information. That is, they allow two
applications, each running on a different node of the network to interact with each other through

22
the services provided by their respective operating systems. Together, these are data processing
oriented.

Figure: OSI Reference Model


1. Layer – 1: Physical Layer – The lowest layer of the OSI reference model is the
physical layer. It is responsible for the actual physical connection between the devices.
The physical layer contains information in the form of bits. 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. Hub, Repeater, Modem, Cables
are Physical Layer devices.

The functions of the physical layer are :


• 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.

23
• Bit rate control : The Physical layer also defines the transmission rate i.e. the
number of bits sent per second.

• Physical topologies : Physical layer specifies the way in which the different,
devices/nodes are arranged in a network i.e. bus, star or mesh topolgy.
• 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.

2. Layer – 2 : Data link Layer – The data link layer is responsible for the node to node
delivery of the message. The main function of this layer is to make sure data transfer is
error free from one node to another, over the physical layer. When a packet arrives in a
network, it is the responsibility of DLL to transmit it to the Host using its MAC address.
Data Link Layer is divided into two sub layers :

• Logical Link Control (LLC)

• Media Access Control (MAC)

Packet received from 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.
The Receiver’s MAC address is obtained by placing an ARP(Address Resolution
Protocol) request onto the wire asking “Who has that IP address?” and the destination
host will reply with its MAC address.
Packet in Data Link layer is referred as Frame and Switches and Bridges are the data
link layer devices.

The functions of the data Link layer are :


• 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.

24
• Physical addressing : After creating frames, Data link layer adds physical
addresses (MAC address) of sender and/or receiver in the header of each frame.
• Error control : Data link layer provides the mechanism of error control in which it
detects and retransmits damaged or lost frames.
• Flow Control : The data rate must be constant on both sides else the data may get
corrupted thus , flow control coordinates that amount of data that can be sent before
receiving acknowledgement.
• Access control : When a single communication channel is shared by multiple
devices, MAC sub-layer of data link layer helps to determine which device has
control over the channel at a given time.
3. Layer – 3 : Network Layer – Network layer works for the transmission of data from
one host to the other located in different networks. It also takes care of packet routing
i.e. selection of shortest path to transmit the packet, from the number of routes available.
The sender & receiver’s IP address are placed in the header by network layer. Segment
in Network layer is referred as Packet. Router works in this layer.

The functions of the Network layer are :


• Routing: The network layer protocols determine which route is suitable from
source to destination. This function of network layer is known as routing.
• Logical Addressing: In order to identify each device on internetwork uniquely,
network layer defines an addressing scheme. The sender & receiver’s IP address are
placed in the header by network layer. Such an address distinguishes each device
uniquely and universally.

• Packetizing: A Network Layer receives the packets from the upper layer and
converts them into packets. This process is known as Packetizing. It is achieved by
internet protocol (IP).

25
4. Layer – 4 : Transport Layer – Transport layer provides services to application layer
and takes services from network layer. The data in the transport layer is referred to as
Segments. It is responsible for the End to End delivery of the complete message.
Transport layer is operated by the Operating System. It is a part of the OS and
communicates with the Application Layer by making system calls. Transport Layer is
called as Heart of OSI model. Transport layer also provides the acknowledgement of
the successful data transmission and re-transmits the data if error is found. Gateway
and firewall works in this layer.

• At sender’s side : Transport layer receives the formatted data from the upper layers,
performs Segmentation and also implements Flow & Error control to ensure proper
data transmission. It also adds Source and Destination port number in its header and
forwards the segmented data to the Network Layer.

Note : The sender need to know the port number associated with the receiver’s
application.
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 number 80, because this is the default port assigned to web applications.
Many applications have default port 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 :


• Segmentation and Reassembly : This layer accepts the message from the (session)
layer , breaks the message into smaller units . Each of the segment produced has a
header associated with it. The transport layer at the destination station reassembles
the message.

26
• Service Point Addressing : In order to deliver the message to correct process,
transport layer header includes a type of address called service point address or port
address. Thus by specifying this address, transport layer makes sure that the
message is delivered to the correct process.

• Flow control: The transport layer also responsible for flow control but it is
performed end-to-end rather than across a single link.

• Error control: The transport layer is also responsible for Error control. Error
control is performed end-to-end rather than across the single link. The sender
transport layer ensures that message reach at the destination without any error.

The services provided by transport layer :


• Connection Oriented Service : It is a three phase process which include
Connection Establishment, Data Transfer, Termination/disconnection. In this type
of transmission the receiving device sends an acknowledgment, back to the source
after a packet or group of packet is received. This type of transmission is reliable
and secure.
• Connection less service : It is a one phase process and includes Data Transfer. In
this type of transmission the receiver does not acknowledge receipt of a packet. This
approach allows for much faster communication between devices. Connection
oriented Service is more reliable than connection less Service.

5. Layer – 5: Session Layer – This layer is responsible for establishment of connection,


maintenance of sessions, authentication and also ensures security.

The functions of the session layer are :

27
• Session establishment, maintenance and termination: The layer allows the two
processes to establish, use and terminate a connection.

• Synchronization : This layer allows a process to add checkpoints which are


considered as synchronization points into the data. These synchronization point help
to identify the error so that the data is re-synchronized properly, and ends of the
messages are not cut prematurely and data loss is avoided.
• Dialog Controller : The session layer determines which device will communicate
first and the amount of data that will be sent.

6. Layer – 6 : Presentation Layer – Presentation layer is also called the Translation layer.
The data from the application layer is extracted here and manipulated as per the required
format to transmit over the network.

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 cipher text 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. Data compression is very important in multimedia such as text, audio,
video.

7. Layer – 7 : Application Layer – At the very top of the OSI Reference Model stack of
layers, we find 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 window for the application services to access the network and for

28
displaying the received information to the user. Application Layer is also called as
Desktop Layer. Ex: Application – Browsers, Skype Messenger etc.

Specific services provided by the application layer include the following:


 Network virtual terminal. A network virtual terminal is a software version of a
physical terminal, and it allows a user to log on to a remote host. To do so, the
application creates a software emulation of a terminal at the remote host. The user's
computer talks to the software terminal which, in turn, talks to the host, and vice
versa. The remote host believes it is communicating with one of its own terminals
and allows the user to log on.
 File transfer, access, and management. This application allows a user to access
files in a remote host (to make changes or read data), to retrieve files from a remote
computer for use in the local computer, and to manage or control files in a remote
computer locally.
 Mail services. This application provides the basis for e-mail forwarding and
storage.
 Directory services. This application provides distributed database sources and
access for global information about various objects and services.

29
TCP/IP Protocol Suite
TCP/IP that is Transmission Control Protocol and Internet Protocol was developed by
Department of Defense’s Project Research Agency (ARPA, later DARPA) as a part of a
research project of network interconnection to connect remote machines.
The features that stood out during the research, which led to making the TCP/IP reference
model were:
 Support for a flexible architecture. Adding more machines to a network was easy.
 The network was robust, and connections remained intact until the source and destination
machines were functioning.

The overall idea was to allow one application on one computer to talk to (send data packets)
another application running on different computer.

APPLICATION LAYER

TRANSPORT LAYER

INTERNET LAYER

LINK/PHYSICAL LAYER

Figure: Layers of TCP/IP reference model

30
1. Application Layer (Layer 4)
The top layer of the protocol stack is the application layer. It refers to the programs that initiate
communication in the first place. TCP/IP includes several application layer protocols for mail,
file transfer, remote access, authentication and name resolution. These protocols are embodied
in programs that operate at the top layer just as any custom-made or packaged client/server
application would.
There are many Application Layer protocols and new protocols are always being developed.
The most widely known Application Layer protocols are those used for the exchange of user
information, some of them are:
 HTTP: HTTP stands for Hypertext transfer protocol. This protocol allows us to access the
data over the world wide web. It transfers the data in the form of plain text, audio, video.
It is known as a Hypertext transfer protocol as it has the efficiency to use in a hypertext
environment where there are rapid jumps from one document to another.
 The File Transfer Protocol (FTP) is used for interactive file transfer.
 The Simple Mail Transfer Protocol (SMTP) is used for the transfer of mail messages
and attachments.
 Telnet, is a terminal emulation protocol, and, is used for remote login to network hosts.
Other Application Layer protocols that help in the management of TCP/IP networks are:
 The Domain Name System (DNS), which, is used to resolve a host name to an IP
address.
 The Simple Network Management Protocol (SNMP) which is used between network
management consoles and network devices (routers, bridges, and intelligent hubs) to collect
and exchange network management information.
Examples of Application Layer interfaces for TCP/IP applications are Windows Sockets and
NetBIOS. Windows Sockets provides a standard application programming interface (API)
under the Microsoft Windows operating system. NetBIOS is an industry standard interface for
accessing protocol services such as sessions, datagrams, and name resolution.

2. Transport Layer (Layer 3)


The Transport Layer (also known as the Host-to-Host Transport Layer) is responsible for
providing the Application Layer with session and datagram communication services.
TCP/IP does not contain Presentation and Session layers, the services are performed if required,
but they are not part of the formal TCP/IP stack. For example, Layer 6 (Presentation Layer) is
where data conversion (ASCII to EBCDIC, floating point to binary, etc.) and encryption
/decryption is performed. Layer 5 is the Session Layer, which is performed in layer 4 in
TCP/IP. Thus, we jump from layer 7 of OSI down to layer 4 of TCP/IP.
From Application to Transport Layer, the application delivers its data to the communications
system by passing a stream of data bytes to the transport layer along with the socket of the
destination machine.
The core protocols of the Transport Layer are TCP and the User Datagram Protocol (UDP).
TCP: It provides a full transport layer services to applications.

 It creates a virtual circuit between the sender and receiver, and it is active for
the duration of the transmission.

31
 TCP is a reliable protocol as it detects the error and retransmits the damaged
frames. Therefore, it ensures all the segments must be received and
acknowledged before the transmission is considered to be completed and a
virtual circuit is discarded.
 At the sending end, TCP divides the whole message into smaller units
known as segment, and each segment contains a sequence number which is
required for reordering the frames to form an original message.
 At the receiving end, TCP collects all the segments and reorders them based
on sequence numbers.

 UDP: UDP provides a one-to-one or one-to-many, connectionless, unreliable


communications service. UDP is used when the amount of data to be transferred is small
(such as the data that would fit into a single packet), when the overhead of establishing a
TCP connection is not desired, or when the applications or upper layer protocols provide
reliable delivery.

UDP consists of the following fields:


 Source port address: The source port address is the address of the application
program that has created the message.
 Destination port address: The destination port address is the address of the
application program that receives the message.
 Total length: It defines the total number of bytes of the user datagram in
bytes.
 Checksum: The checksum is a 16-bit field used in error detection.
UDP does not specify which packet is lost. UDP contains only checksum; it does not
contain any ID of a data segment.

The Transport Layer encompasses the responsibilities of the OSI Transport Layer and some of
the responsibilities of the OSI Session Layer.
3. Internet Layer (Layer 2)
The Internet layer handles the transfer of information across multiple networks through the use
of gateways and routers. The Internet layer corresponds to the part of the OSI network layer

32
that is concerned with the transfer of packets between machines that are connected to different
networks. It deals with the routing of packets across these networks as well as with the control
of congestion. A key aspect of the Internet layer is the definition of globally unique addresses
for machines that are attached to the Internet.
The Internet layer provides a single service namely, best-effort connectionless packet transfer.
IP packets are exchanged between routers without a connection setup; the packets are routed
independently and so they may traverse different paths. For this reason, IP packets are also
called datagrams. The connectionless approach makes the system robust; that is, if failures
occur in the network, the packets are routed around the points of failure; hence, there is no need
to set up connections. The gateways that interconnect the intermediate networks may discard
packets when congestion occurs. The responsibility for recovery from these losses is passed on
to the Transport Layer.
The core protocols of the Internet Layer are IP, ARP, ICMP, and IGMP.
 The Internet Protocol (IP) is a routable protocol responsible for IP addressing and the
fragmentation and reassembly of packets.

Following are the responsibilities of this protocol:

 IP Addressing: This protocol implements logical host addresses known as IP


addresses. The IP addresses are used by the internet and higher layers to identify
the device and to provide internetwork routing.
 Host-to-host communication: It determines the path through which the data is
to be transmitted.
 Data Encapsulation and Formatting: An IP protocol accepts the data from the
transport layer protocol. An IP protocol ensures that the data is sent and received
securely, it encapsulates the data into message known as IP datagram.
 Fragmentation and Reassembly: The limit imposed on the size of the IP
datagram by data link layer protocol is known as Maximum Transmission unit
(MTU). If the size of IP datagram is greater than the MTU unit, then the IP
protocol splits the datagram into smaller units so that they can travel over the
local network. Fragmentation can be done by the sender or intermediate router.
At the receiver side, all the fragments are reassembled to form an original
message.
 Routing: When IP datagram is sent over the same local network such as LAN,
MAN, WAN, it is known as direct delivery. When source and destination are on
the distant network, then the IP datagram is sent indirectly. This can be
accomplished by routing the IP datagram through various devices such as
routers.

33
 The Address Resolution Protocol (ARP) is responsible for the resolution of the Internet
Layer address to the Network Interface Layer address, such as a hardware address.

The two terms are mainly associated with the ARP Protocol:
 ARP request: When a sender wants to know the physical address of the device,
it broadcasts the ARP request to the network.
 ARP reply: Every device attached to the network will accept the ARP request
and process the request, but only recipient recognize the IP address and sends
back its physical address in the form of ARP reply. The recipient adds the physical
address both to its cache memory and to the datagram header
 The Internet Control Message Protocol (ICMP) is responsible for providing diagnostic
functions and reporting errors or conditions regarding the delivery of IP packets.
 A datagram travels from router-to-router until it reaches its destination. If a router is
unable to route the data because of some unusual conditions such as disabled links,
a device is on fire or network congestion, then the ICMP protocol is used to inform
the sender that the datagram is undeliverable.

 An ICMP protocol mainly uses two terms:

 ICMP Test: ICMP Test is used to test whether the destination is reachable or not.

 ICMP Reply: ICMP Reply is used to check whether the destination device is
responding or not.

 The core responsibility of the ICMP protocol is to report the problems, not correct
them. The responsibility of the correction lies with the sender.
ICMP can send the messages only to the source, but not to the intermediate routers
because the IP datagram carries the addresses of the source and destination but not of
the router that it is passed to.
 The Internet Group Management Protocol (IGMP) is responsible for the management
of IP multicast groups.

4. Link/Physical Layer (Layer 1)


The Link/Physical Layer (also called the Network Access Layer) is responsible for placing
TCP/IP packets on the network medium and receiving TCP/IP packets of the network medium.
TCP/IP was designed to be independent of the network access method, frame format, and
medium. In this way, TCP/IP can be used to connect differing network types. This includes
LAN technologies such as Ethernet or Token Ring and WAN technologies such as X.25 or
Frame Relay. Independence from any specific network technology gives TCP/IP the ability to
be adapted to new technologies such as Asynchronous Transfer Mode (ATM).
The Network Interface Layer encompasses the Data Link and Physical layers of the OSI
Model. Note, that the Internet Layer does not take advantage of sequencing and

34
acknowledgement services that may be present in the Data Link Layer. An unreliable Network
Interface Layer is assumed, and reliable communications through session establishment and
the sequencing and acknowledgement of packets is the responsibility of the Transport Layer.

Comparison of OSI Reference Model and TCP/IP Reference model

OSI(Open System Interconnection) TCP/IP(Transmission Control


Protocol / Internet Protocol)
1. TCP/IP model is based on standard
1. OSI is a generic, protocol independent
protocols around which the Internet has
standard, acting as a communication
developed. It is a communication
gateway between the network and end
protocol, which allows connection of
user.
hosts over a network.
2. In TCP/IP model the transport layer does
2. In OSI model the transport layer
not guarantee delivery of packets. Still
guarantees the delivery of packets.
the TCP/IP model is more reliable.
3. Follows horizontal approach.
3. Follows vertical approach.
4. OSI model has a separate Presentation 4. TCP/IP does not have a separate
Presentation layer or Session layer.
layer and Session layer.
5. OSI is a reference model around which the 5. TCP/IP model is, in a way
implementation of the OSI model.
networks are built. Generally it is used as
a guidance tool.
6. Network layer of OSI model provides both 6. The Network layer in TCP/IP model
provides connectionless service.
connection oriented and connectionless
service.
7. OSI model has a problem of fitting the 7. TCP/IP model does not fit any protocol
protocols into the model.
8. Protocols are hidden in OSI model and are 8. In TCP/IP replacing protocol is not
easy.
easily replaced as the technology changes.

9. OSI model defines services, interfaces and 9. In TCP/IP, services, interfaces and
protocols are not clearly separated. It is
protocols very clearly and makes clear
also protocol dependent.
distinction between them. It is protocol
independent.
10. It has 4 layers
10. It has 7 layers

35
Critiques of OSI Reference Model

Neither the OSI model and its protocols nor the TCP/IP model and its protocols are perfect.

The criticism of the OSI model and its protocols can be summarized as:

1. Bad timing.
2. Bad technology.
3. Bad implementations.
4. Bad politics.

Bad timing

The competing TCP/IP protocols were already in widespread use by research universities
by the time the OSI protocols appeared. While the billion-dollar wave of investment had not
yet hit, the academic market was large enough that many vendors had begun cautiously offering
TCP/IP products. When OSI came around, they did not want to support a second protocol stack
until they were forced to, so there were no initial offerings. With every company waiting for
every other company to go first, no company went first and OSI never happened.

36
Bad Technology

The second reason that OSI never caught on is that both the model and the protocols are
defective. The choice of seven layers was more political than technical, and two of the layers
(session and presentation) are nearly empty, whereas two other ones (data link and network)
are overfull. The OSI model, along with its associated service definitions and protocols, is
extraordinarily complex. They are also difficult to implement and inefficient in operation. In
addition to being incomprehensible, another problem with OSI is that some functions, such as
addressing, flow control, and error control, reappear again and again in each layer.

Bad Implementations

Given the enormous complexity of the model and the protocols, it will come as no surprise
that the initial implementations were huge, unwieldy, and slow. It did not take long for people
to associate "OSI" with "poor quality". Although the products improved in the course of time,
the image stuck.

In contrast, one of the first implementations of TCP/IP was part of Berkeley UNIX and was
quite good. People began using it quickly, which led to a large user community, which led to
improvements, which led to an even larger community. Here the spiral was upward instead of
downward.

Bad Politics

On account of the initial implementation, many people, especially in academia, thought of


TCP/IP as part of UNIX, and UNIX in the 1980s in academia was not unlike parenthood and
apple pie.

OSI, on the other hand, was widely thought to be the creature of the European
telecommunication ministries. The very idea of a bunch of government bureaucrats trying to
shove a technically inferior standard down the throats of the poor researchers and programmers
down in the trenches actually developing computer networks did not aid OSI's cause.

37
Critiques of TCP/IP Reference Model

1. Service, interface, and protocol not distinguished.


2. Not a general model.
3. Host-to-network “layer” not really a layer.
4. No mention of physical and data link layers.
5. Minor protocols deeply establish, hard to replace.

38
Unit-2
The Physical layer
Functions of Physical Layer
Physical layer is the lowest layer of the OSI reference model. It is responsible for sending bits
from one computer to another. This layer is not concerned with the meaning of the bits and
deals with the setup of physical connection to the network and with transmission and reception
of signals. Physical Layer devices are Hub, Repeater, Modem, Cables. Following are the
functions of physical layer:

1. Representation of bits: The physical layer data involves a stream of bits (sequence of 0's
and 1's) without any interpretation. To be transmitted bits must be encoded into the signals
electrical or optical.

• The physical layer defines the type of encoding (how 0's and 1's are changed in
signals).
• This layer is responsible for the bit by bit delivery of the data to its upper layer called
the MAC layer. Physical layer obtains data in the form of signals or the radio signals
or the optical signals.
• The physical layer is responsible for delivering those signals from a cable, a Wi-Fi
router or an optical fiber.

2. Data Rate (Transmission Rate): The number of bits sends each second is also defined by
the physical layer. In other words, the physical layer defines the duration of a bit also.
3. Synchronization of bits: It is necessary to have synchronization between sender and
receiver at the bit level that is the clocks of the sender and the receiver must be
synchronized.
4. Line configuration: The physical layer is responsible for the connection of devices to the
medium. Two devices are connected through a dedicated link in a point-to-point
configuration.
5. Physical topology: The Physical topology determines how devices are connected to create
a network. Devices can be using a mesh topology (every device can be connected to other
devices), a star topology (all the devices are connected through a central device), a ring

39
topology (devices are connected to the next forming a ring), or a bus topology (every
device shared a common link).
6. Transmission mode: The mechanism of transferring data or information between two
linked devices connected over a network is referred to as Transmission Modes. They are
simplex, half-duplex, or full-duplex.
Design issues with physical layer
• The Physical Layer is transmitted raw bits over a communication channel.
• Making sure that when one side sends a 1 bit, it is received by the other side as a 1 bit
and not as a 0 bit.
• The design issues here mostly deal with electrical, mechanical and timing interfaces.

Data and Signals


The term analog data refers to information that is continuous; digital data refers to information
that has discrete states. To be transmitted, data must be transformed to electromagnetic signals.

Analog and Digital signals:

Analog Signal Digital Signal


1. An analog signal is a continuous signal 1. Digital signals are time separated signals
that represents physical measurements. which are generated using digital
modulation.

2. It is denoted by sine waves. 2. It is denoted by square waves.

3. It uses a continuous range of values 3. Digital signal uses discrete 0 and 1 to


that help you to represent information. represent information.

4. The analog signal bandwidth is low 4. The digital signal bandwidth is high.

5. Analog signals are deteriorated by 5. Relatively a noise-immune system


noise throughout transmission as well without deterioration during the
as write/read cycle. transmission process and write/read cycle.

6. It is suited for audio and video 6. It is suited for Computing and digital
transmission. electronics.

7. Analog signal doesn't offer any fixed 7. Digital signal has a finite number, i.e., 0
range. and 1.

40
Analog and digital signals can take one of two forms: periodic or non-periodic
• Periodic Signal: A periodic signal completes a pattern within a measurable time
frame, called a period, and repeats that pattern over subsequent identical periods. The
completion of one full pattern is called a cycle.

• Non-periodic signal: A non-periodic signal changes without exhibiting a pattern or


cycle that repeats over time.

• Period refers to the amount of time, in seconds, a signal needs to complete 1 cycle.
Frequency refers to the number of periods in I s.
f= 1/T and t= 1/F

Transmission impairments
When data is transmitted from a transmitter to receiver, there is scope for transmission errors.
If, transmission media were perfect, the receiver would receive exactly the same signal that the
transmitter sent. Unfortunately, media are not perfect, so the received signal may sometimes
not be the same as the transmitted signal.
Transmission lines suffer from three major problems:
• Attenuation.
• Delay distortion.
• Noise.
Attenuation
Attenuation is the loss of energy as the signal propagates outwards. On guided media (e.g.,
wires and optical fibers), the signal falls off logarithmically with the distance. Attenuation is
very small at short distances; therefore, the original signal can be recognized without too much
distortion. Attenuation increases with distance as, some of the signal energy is absorbed by the
medium. The loss is expressed in decibels per kilometer (db/km). The amount of energy lost
depends on the frequency. Attenuation is also higher at higher frequencies.
If the attenuation is high, the receiver may not be able to detect the signal at all, or the signal
may fall below the noise level. In many cases, the attenuation properties of a medium are
known, so amplifiers can be put in place to try to compensate for the frequency-dependent
attenuation. This approach helps but can never restore the signal exactly back to its original
shape.

41
Figure: Measurement of attenuation

A loss of 3 dB (–3 dB) is equivalent to losing one-half the power.


Distortion
Means that the signal changes its form or shape. Distortion occurs in composite signals.
Each frequency component has its own propagation speed traveling through a medium.
The different components therefore arrive with different delays at the receiver.
That means that the signals have different phases at the receiver than they did at the source.
The velocity of propagation of different frequency components of a signal are different in
guided media. This leads to delay distortion in the signal. For a band limited signal, the velocity
of propagation has been found to be maximum near the center frequency and lower on both
sides of the edges of the frequency band. In case of analog signals, the received signal is
distorted because of variable delay of different components. In case of digital signals, the
problem is much more severe. Some frequency components of one-bit position spill over to
other bit positions, because of delay distortion. This leads to intersymbol interference, which
restricts the maximum bit rate of transmission through a particular transmission medium. The
delay distortion can also be neutralized, like attenuation distortion, by using suitable equalizers.

42
Figure: Distortion
Noise
Noise is unwanted energy from sources other than the transmitter. Noise can be categorized
into the following four types:

Figure: Noise as impairments


a. Thermal noise: The thermal noise is due to thermal agitation of electrons in a conductor.
It is distributed across the entire spectrum and that is why it is also known as white
noise (as the frequency encompass over a broad range of frequencies).
b. Intermodulation noise: When more than one signal share a single transmission
medium, intermodulation noise is generated. For example, two signals f1 and f2 will
generate signals of frequencies (f1 + f2) and (f1 - f2), which may interfere with the
signals of the same frequencies sent by the transmitter. Intermodulation noise is
introduced due to nonlinearity present in any part of the communication system.
c. Cross talk : Cross talk is a result of bunching several conductors together in a single
cable. Signal carrying wires generate electromagnetic radiation, which is induced on
other conductors because of close proximity of the conductors. While using telephone,
it is a common experience to hear conversation of other people in the background. This
is known as cross talk.
d. Impulse noise: Impulse noise is irregular pulses or noise spikes of short duration
generated by phenomena like lightning, spark due to loose contact in electric circuits,
etc. Impulse noise is a primary source of bit-errors in digital data communication. This
kind of noise introduces burst errors.

43
Data Rate Limits
• Data rate governs the speed of data transmission.
• A very important consideration in data communication is how fast we can send data, in
bits per second, over a channel.
Data rate depends upon 3 factors:
1. The bandwidth available
2. Number of levels in digital signal
3. The quality of the channel – level of noise

Two theoretical formulas were developed to calculate the data rate:

1. Noiseless Channel: Nyquist Bit Rate


2. Noisy Channel: Shannon Capacity

1. Noiseless Channel: Nyquist Bit Rate

BitRate = 2 * Bandwidth * log2(L)

Where, Bandwidth is the bandwidth of the channel, L is the number of signal levels used to
represent data, and BitRate is the bit rate in bits per second.

Bandwidth is a fixed quantity, so it cannot be changed. Hence, the data rate is directly
proportional to the number of signal levels.
Note –Increasing the levels of a signal may reduce the reliability of the system.

a : Consider a noiseless channel with a bandwidth of 3000 Hz transmitting a signal with two
signal levels. What can be the maximum bit rate?
BitRate = 2 * 3000 * log2(2) = 6000bps

b : We need to send 265 kbps over a noiseless channel with a bandwidth of 20 kHz. How many
signal levels do we need?
265000 = 2 * 20000 * log2(L)
=> log2(L) = 6.625
=> L = 26.625 = 98.7 levels

2. Noisy Channel: Shannon Capacity

In reality, we cannot have a noiseless channel; the channel is always noisy. Shannon capacity
is used, to determine the theoretical highest data rate for a noisy channel:
Capacity = Bandwidth * log2(1 + SNR)

Where, Bandwidth is the bandwidth of the channel, SNR is the signal-to-noise ratio, and
Capacity is the capacity of the channel in bits per second. Bandwidth is a fixed quantity, so it

44
cannot be changed. Hence the channel capacity is directly proportional to the power of the
signal, as

SNR = (Power of signal) / (power of noise).

The signal-to-noise ratio (S/N) is usually expressed in decibels (dB) given by the formula:
10 * log10(S/N)
so for example a signal-to-noise ratio of 1000 is commonly expressed as:

10 * log10(1000)

=10* 3

=30 dB

Note: The Shannon capacity gives us the upper limit; the Nyquist formula tells us how many
signal levels we need.

Q1 : A telephone line normally has a bandwidth of 3000 Hz (300 to 3300 Hz) assigned for data
communication.
The SNR is usually 3162. What will be the capacity for this channel?
Capacity = Bandwidth * log2(1 + SNR)

Capacity = 3000 * log2(1 + SNR)

=3000 * log2(1 + 3162)

=3000 * log2(3163)

=3000 *11.62

= 34860 bps

Q2 : The SNR is often given in decibels. Assume that SNR(dB) is 36 and the channel
bandwidth is 2 MHz. Calculate the theoretical channel capacity.

SNR(dB) = 10 * log10(SNR)
𝑆𝑁𝑅(𝑑𝐵)
=> = log10(SNR)
10

𝑆𝑁𝑅(𝑑𝐵)
=> SNR = 10( 10
)

36
=> SNR = 10(10)

=> SNR =103.6

=> SNR =3981

45
Now, Capacity = Bandwidth * log2(1 + SNR)

Capacity = 2* log2(1 + 3981)

= 2* log2(3982)

= 2*11.95

= 24 MHz

Performance
Performance of a network relates to the measure of service quality of a network as perceived
by the user. There are different ways to measure the performance of a network, depending
upon the nature and design of the network. The characteristics that measure the performance
of a network are:
 Bandwidth
 Throughput
 Latency (Delay)
 Bandwidth – Delay Product
 Jitter

1. Bandwidth
The bandwidth of a network is given by the number of bits that can be transmitted over the
network in a certain period of time. Bandwidth is the maximum amount of data that can be
travelled through a channel. Bandwidth of analog and digital signals is calculated in separate
ways:
Bandwidth of an Analog Signal (in hz)

In figure the signal has a minimum frequency of F1 = 1000Hz and maximum frequency of F2
= 5000Hz. Hence, the bandwidth is given by F2 - F1= 5000 - 1000 = 4000 Hz

Bandwidth of a Digital Signal (in bps)

For example: The bandwidth of a Fast Ethernet is a maximum of 100 Mbps. (This means that
this network can send 100 Mbps).

2. Throughput

46
Throughput is the number of messages successfully transmitted per unit time. Bandwidth is
the potential measurement of a link, whereas throughput is an actual measurement of how
fast we can send data. Throughput is how much data actually does travel through the channel
successfully.
A network with bandwidth of 10 Mbps can pass only an average of 12,000 frames per minute
where each frame carries an average of 10,000 bits. What will be the throughput for this
network?

Throughput = (12,000 x 10,000) / 60 = 2 Mbps

3. Latency
Latency (also known as delay) is defined as the total time taken for a complete message to
arrive at the destination, starting with the time when the first bit of the message is sent out
from the source and ending with the time when the last bit of the message is delivered at the
destination.
Latency = Propagation Time + Transmission Time + Queuing Time + Processing Delay
Propagation time is defined as the time required for a bit to travel from source to destination.

4. Bandwidth – Delay Product


Bandwidth and delay are two performance measurements of a link. However, what is
significant in data communications is the product of the two, the bandwidth-delay product.
Assume a link is of bandwidth 1bps and the delay of the link is 5s. Let us find the bandwidth-
delay product in this case. From the image, we can say that this product 1 x 5 is the maximum
number of bits that can fill the link. There can be close to 5 bits at any time on the link.

47
5. Jitter

Jitter is a “packet delay variance”. It can simply mean that jitter is considered as a problem
when different packets of data face different delays in a network and the data at the receiver
application is time-sensitive, i.e. audio or video data. Jitter is measured in milliseconds (ms).
It is defined as an interference in the normal order of sending data packets. For example: if
the delay for the first packet is 10 ms, for the second is 35 ms, and for the third is 50 ms, then
the real-time destination application that uses the packets experiences jitter. The major causes
of jitter are: electromagnetic interference(EMI) and crosstalk between signals.

Data Transmission media


Transmission media is a pathway that carries the information from sender to receiver. We use
different types of cables or waves to transmit data. Data is transmitted normally through
electrical or electromagnetic signals.
An electrical signal is in the form of current. An electromagnetic signal is series of
electromagnetic energy pulses at various frequencies. These signals can be transmitted through
copper wires, optical fibers, atmosphere, water and vacuum Different Medias have different
properties like bandwidth, delay, cost and ease of installation and maintenance. Transmission
media is also called Communication channel.
Types of transmission media
 Guided Transmission media
 Unguided Transmission media

A. Guided Transmission media


Guided transmission media are more commonly known as the wired communication or
bounded transmission media. The electromagnetic signals travel between the communicating
devices through a physical medium/conductor. As the medium for transmission is a physical
conductor, it also provides direction to the signal. But there are physical limitations of the
conductor in the guided media. Like the length of the conductor, its installation cost, its
maintenance, etc. The guided media is categorized further into three categories that are twisted-
pair cable, coaxial cable and fiber-optic cable.
1. Twisted Pair Cable
This cable is the most commonly used and is cheaper than others. It is lightweight, cheap, can
be installed easily, and they support many different types of network. Some important points:

• Its frequency range is 0 to 3.5 kHz.


• Typical attenuation is 0.2 dB/Km @ 1kHz.

48
• Typical delay is 50 µs/km.
• Repeater spacing is 2km.

A twisted pair consists of two conductors (normally copper), each with its own plastic
insulation, twisted together. One of these wires is used to carry signals to the receiver, and the
other is used only as ground reference. The receiver uses the difference between the two. In
addition to the signal sent by the sender on one of the wires, interference(noise) and crosstalk
may affect both wires and create unwanted signals. If the two wires are parallel, the effect of
these unwanted signals is not the same in both wires because they are at different locations
relative to the noise or crosstalk sources.
This results in a difference at the receiver.

Twisted Pair is of two types:

i Unshielded Twisted Pair (UTP)


ii Shielded Twisted Pair (STP)

i. Unshielded Twisted Pair Cable


It is the most common type of telecommunication when compared with Shielded Twisted Pair
Cable which consists of two conductors usually copper, each with its own color plastic
insulator. Identification is the reason behind colored plastic insulation.

UTP cables consist of 2 or 4 pairs of twisted cable. Cable with 2 pair use RJ-11 connector and
4 pair cable use RJ-45 connector.

Advantages of using UTP :

• Installation is easy
• Flexible
• Cheap
• It has high speed capacity,
• 100 meter limit
• Higher grades of UTP are used in LAN technologies like Ethernet.

It consists of two insulating copper wires (1mm thick). The wires are twisted together in a
helical form to reduce electrical interference from similar pair.

49
Disadvantages of using UTP

• Bandwidth is low when compared with Coaxial Cable.


• Provides less protection from interference.

ii. Shielded Twisted Pair Cable


This cable has a metal foil or braided-mesh covering which encases each pair of insulated
conductors. Electromagnetic noise penetration is prevented by metal casing. Shielding also
eliminates crosstalk.

It has same attenuation as unshielded twisted pair. It is faster then unshielded and coaxial cable.
It is more expensive than coaxial and unshielded twisted pair.

Advantages of using STP


• Easy to install
• Performance is adequate.
• Can be used for Analog or Digital transmission.
• Increases the signaling rate.
• Higher capacity than unshielded twisted pair.
• Eliminates crosstalk.
Disadvantages of using STP
• Difficult to manufacture
• Heavy

Applications
• In telephone lines to provide voice and data channels. The DSL lines that are
used by the telephone companies to provide high-data-rate connections also use the
high-bandwidth capability of unshielded twisted-pair cables.
• Local Area Network, such as 10Base-T and 100Base-T, also use twisted-pair
cables.
2. Coaxial Cable
Coaxial is called by this name because it contains two conductors that are parallel to each other.
Copper is used in this as center conductor which can be a solid wire or a standard one. It is

50
surrounded by PVC installation, a sheath which is encased in an outer conductor of metal foil,
braid or both.

Outer metallic wrapping is used as a shield against noise and as the second conductor which
completes the circuit. The outer conductor is also encased in an insulating sheath. The
outermost part is the plastic cover which protects the whole cable.

Here the most common coaxial standards.

• 50-Ohm RG-7 or RG-11 : used with thick Ethernet.


• 50-Ohm RG-58 : used with thin Ethernet.
• 75-Ohm RG-59 : used with cable television.93-Ohm RG-62 : used with ARCNET.

Figure: coaxial cable

There are two types of Coaxial cables :


i. BaseBand : This is a 50 ohm (Ω) coaxial cable which is used for digital transmission.
It is mostly used for LAN's. Baseband transmits a single signal at a time with very high
speed. The major drawback is that it needs amplification after every 1000 feet.
ii. BroadBand : This uses analog transmission on standard cable television cabling. It
transmits several simultaneous signal using different frequencies. It covers large area
when compared with Baseband Coaxial Cable.
Advantages are :
• Bandwidth is high
• Used in long distance telephone lines.
• Transmits digital signals at a very high rate of 10Mbps.
• Much higher noise immunity
• Data transmission without distortion.
• The can span to longer distance at higher speeds as they have better shielding
when compared to twisted pair cable.

51
Disadvantages are
• Single cable failure can fail the entire network.
• Difficult to install and expensive when compared with twisted pair.
• If the shield is imperfect, it can lead to grounded loop.

Applications

 Coaxial cable was widely used in analog telephone networks, where a single coaxial
network could carry 10,000 voice signals.
 Cable TV networks also use coaxial cables. In the traditional cable TV network, the
entire network used coaxial cable. Cable TV uses RG-59 coaxial cable.
 In traditional Ethernet LANs. Because of it high bandwidth, and consequence high
data rate, coaxial cable was chosen for digital transmission in early Ethernet LANs.
The 10Base-2, or Thin Ethernet, uses RG-58 coaxial cable with BNC connectors to
transmit data at 10Mbps with a range of 185 m.

3. Optical Fiber
A fiber-optic cable is made of glass or plastic and transmits signals in the form of light. For
better understanding we first need to explore several aspects of the nature of light. Light travels
in a straight line as long as it is mobbing through a single uniform substance. If ray of light
traveling through one substance suddenly enters another substance (of a different density), the
ray changes direction.

The below figure shows how a ray of light changes direction when going from a more dense to
a less dense substance.

Figure: Bending of the light

 If the angle of incidence I( the angle the ray makes with the line perpendicular to the
interface between the two substances) is less than the critical angle, the ray refracts and
moves closer to the surface.
 If the angle of incidence is greater than the critical angle, the ray reflects (makes a turn)
and travels again in the denser substance.
52
 If the angle of incidence is equal to the critical angle, the ray refracts and moves parallel
to the surface as shown.

Note: The critical angle is a property of the substance, and its value differs from one
substance to another.

Figure: Internal view of an optical fiber


Optical fibers use reflection to guide light through a channel. A glass or plastic core is
surrounded by a cladding of less dense glass or plastic. The difference in density of the two
materials must be such that a beam of light moving through the core is reflected off the cladding
instead of being refracted into it.

Propagation Modes
Current technology supports two modes (Multimode and Single mode) for propagating light
along optical channels, each requiring fiber with different physical characteristics. Multimode
can be implemented in two forms: Step-index and Graded-index.

Figure: Propagation modes

Multimode
Multimode is so named because multiple beams from a light source move through the core in
different paths. How these beams move within the cable depends on the structure of the core
as shown in the below figure.

53
 In multimode step-index fiber, the density of the core remains constant from the
center to the edges. A beam of light moves through this constant density in a straight
line until it reaches the interface of the core and the cladding. The term step-index
refers to the suddenness of this change, which contributes to the distortion of the
signal as it passes through the fiber.
 In multimode graded-index fiber, this distortion gets decreases through the cable.
The word index here refers to the index of refraction. This index of refraction is
related to the density. A graded-index fiber, therefore, is one with varying densities.
Density is highest at the center of the core and decreases gradually to its lowest at
the edge.

Single Mode
Single mode uses step-index fiber and a highly focused source of light that limits beams to a
small range of angles, all close to the horizontal. The single-mode fiber itself is manufactured
with a much smaller diameter than that of multimode fiber, and with substantially lower
density. The decrease in density results in a critical angle that is close enough to 90 degree to
make the propagation of beams almost horizontal.

Advantages of optical fiber

Fiber optic has several advantages over metallic cable:

• Higher bandwidth
• Less signal attenuation
• Immunity to electromagnetic interference

54
• Resistance to corrosive materials
• Light weight
• Greater immunity to tapping

Disadvantages of optical fiber


There are some disadvantages in the use of optical fiber:

• Installation and maintenance


• Unidirectional light propagation
• High Cost

Applications are

 Often found in backbone networks because its wide bandwidth is cost-effective.


 Some cable TV companies use a combination of optical fiber and coaxial cable thus
creating a hybrid network.
 Local-area Networks such as 100Base-FX network and 1000Base-X also use fiber-
optic cable.
B. Unguided Transmission media
Unguided medium transport electromagnetic waves without using a physical conductor. This
type of communication is often referred to as wireless communication. Signals are normally
broadcast through free space and thus are available to anyone who has a device capable of
receiving them.

The below figure shows the part of the electromagnetic spectrum, ranging from 3 kHz to 900
THz, used for wireless communication.

Unguided signals can travel from the source to the destination in several ways: Ground
propagation, Sky propagation and Line-of-sight propagation as shown in figure below.

Propagation Modes

 Ground Propagation : In this, radio waves travel through the lowest portion of the
atmosphere, hugging the Earth. These low-frequency signals emanate in all directions from
the transmitting antenna and follow the curvature of the planet.

55
 Sky Propagation : In this, higher-frequency radio waves radiate upward into the ionosphere
where they are reflected back to Earth. This type of transmission allows for greater
distances with lower output power.
 Line-of-sight Propagation : in this type, very high-frequency signals are transmitted in
straight lines directly from antenna to antenna.

We can divide wireless transmission into three broad groups:


1. Radio waves
2. Micro waves
3. Infrared waves

1. Radio waves
Electromagnetic waves ranging in frequencies between 3 KHz and 1 GHz are normally called
radio waves.

Radio waves are omnidirectional. When an antenna transmits radio waves, they are propagated
in all directions. This means that the sending and receiving antennas do not have to be aligned.
A sending antenna send waves that can be received by any receiving antenna. The
omnidirectional property has disadvantage, too. The radio waves transmitted by one antenna
are susceptible to interference by another antenna that may send signal suing the same
frequency or band.

Radio waves, particularly with those of low and medium frequencies, can penetrate walls. This
characteristic can be both an advantage and a disadvantage. It is an advantage because, an AM
radio can receive signals inside a building. It is a disadvantage because we cannot isolate a
communication to just inside or outside a building.

56
Omnidirectional Antenna
Radio waves use omnidirectional antennas that send out signals in all directions.

Applications
 The omni directional characteristics of radio waves make them useful for
multicasting in which there is one sender but many receivers.
 AM and FM radio, television, maritime radio, cordless phones, and paging are
examples of multicasting.

2. Micro Waves
Electromagnetic waves having frequencies between 1 and 300 GHz are called micro waves.
Micro waves are unidirectional. When an antenna transmits microwaves, they can be narrowly
focused. This means that the sending and receiving antennas need to be aligned. The
unidirectional property has an obvious advantage. A pair of antennas can be aligned without
interfering with another pair of aligned antennas.

The following describes some characteristics of microwaves propagation:

 Microwave propagation is line-of-sight. Since the towers with the mounted antennas need
to be in direct sight of each other, towers that are far apart need to be very tall.
 Very high-frequency microwaves cannot penetrate walls. This characteristic can be a
disadvantage if receivers are inside the buildings.
 The microwave band is relatively wide, almost 299 GHz. Therefore, wider sub-bands can
be assigned and a high date rate is possible.
 Use of certain portions of the band requires permission from authorities.

There are 2 types of Microwave Transmission:

a. Terrestrial Microwave
For increasing the distance served by terrestrial microwave, repeaters can be installed
with each antenna. The signal received by an antenna can be converted into

57
transmittable form and relayed to next antenna as shown in below figure. It is an
example of telephone systems all over the world.

There are two types of antennas used for terrestrial microwave communication:

 Parabolic Dish Antenna

In every line parallel to the line of symmetry reflects off the curve at angles in a way that they
intersect at a common point called focus. This antenna is based on geometry of parabola. They
are used in satellite communication, broadcast reception, space communication, radar

 Horn Antenna

It is a like gigantic scoop. The outgoing transmissions are broadcast up a stem and deflected
outward in a series of narrow parallel beams by curved head.

Advantages of Microwave Transmission

• Used for long distance telephone communication


• Carries 1000's of voice channels at the same time

58
Disadvantages of Microwave Transmission

• It is Very costly

Applications
Microwaves, due to their unidirectional properties, are very useful when unicast(one-to-one)
communication is needed between the sender and the receiver. They are used in cellular
phones, satellite networks and wireless LANs.

b. Satellite Microwave
This is a microwave relay station which is placed in outer space. The satellites are launched
either by rockets or space shuttles carry them.
These are positioned 36000KM above the equator with an orbit speed that exactly matches the
rotation speed of the earth. As the satellite is positioned in a geo-synchronous orbit, it is
stationery relative to earth and always stays over the same point on the ground. This is usually
done to allow ground stations to aim antenna at a fixed point in the sky.

Features of Satellite Microwave:


• Bandwidth capacity depends on the frequency used.
• Satellite microwave deployment for orbiting satellite is difficult.

Advantages of Satellite Microwave:

 Transmitting station can receive back its own transmission and check whether the
satellite has transmitted information correctly.
 A single microwave relay station which is visible from any point.

Disadvantages of Satellite Microwave:

 Satellite manufacturing cost is very high


 Cost of launching satellite is very expensive
 Transmission highly depends on whether conditions, it can go down in bad weather

59
3. Infrared Waves
Infrared waves, with frequencies from 300 GHz to 400 THz, can be used for short-range
communication. Infrared waves, having high frequencies, cannot penetrate walls. This
advantageous characteristic prevents interference between one system and another, a short-
range communication system in on room cannot be affected by another system in the next
room.

When we use infrared remote control, we do not interfere with the use of the remote by our
neighbors. However, this same characteristic makes infrared signals useless for long-range
communication. In addition, we cannot use infrared waves outside a building because the sun's
rays contain infrared waves that can interfere with the communication.

Applications
a. The infrared band, almost 400 THz, has an excellent potential for data transmission.
Such a wide bandwidth can be used to transmit digital data with a very high data
rate.
b. The Infrared Data Association (IrDA), an association for sponsoring the use of
infrared waves, has established standards for using these signals for communication
between devices such as keyboards, mouse, PCs and printers.
c. Infrared signals can be used for short-range communication in a closed area using
line-of sight propagation.

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 technique is widely used in
telecommunications in which several telephone calls are carried through a single wire.
Multiplexing originated in telegraphy in the early 1870s and is now widely used in
communication. George Owen Squier developed the telephone carrier multiplexing in 1910.

Multiplexing is achieved by using a device called Multiplexer (MUX) that combines n input
lines to generate a single output line. Multiplexing follows many-to-one, i.e., n input lines and
one output line.

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


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

60
Figure: Concept of multiplexing

Why multiplexing?

 The transmission medium is used to send the signal from sender to receiver. The
medium can only have one signal at a time.
 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.
 When multiple signals share the common medium, there is a possibility of collision.
Multiplexing concept is used to avoid such collision.
 Transmission services are very expensive.

Figure: Types of Multiplexing

Analog multiplexing
The process of combining multiple analog signals into one signal is called analog multiplexing.
It multiplexes the analog signals according to their frequency or wavelength.

61
Multiplexing requires that the multiple signals be kept apart so that they do not overlap with
each other and thus can be separated at the receiving end. This can be achieved by separating
the signal in frequency.
There are two types of analog multiplexing:
 Frequency division multiplexing
 Wavelength division multiplexing
Frequency division multiplexing
Frequency division multiplexing is an analog technique. It is the most popular multiplexing
technique. We use this technique extensively in TV and radio transmission. This technique
combines multiple signals into one signal and transmitted over the communication channel.
Frequency division multiplexing is also known as FDM.
In this technique, the bandwidth of the communication channel should be greater than the
combined bandwidth of individual signals.

Figure: Frequency Division Multiplexing


The frequency division multiplexing divides the bandwidth of a channel into several logical
sub-channels. Each logical sub-channel is allotted for a different signal frequency. The
individual signals are filtered and then modulated (frequency is shifted), in order to fit exactly
into logical sub-channels.
In this technique, each logical sub-channel (individual signal frequency) is allotted to each user.
In other words, each user owns a sub-channel.
Each logical sub-channel is separated by an unused bandwidth called Guard Band to prevent
overlapping of signals. In other words, there exists a frequency gap between two adjacent
signals to prevent signal overlapping. A guard band is a narrow frequency range that separates
two signal frequencies.

62
How FDM System works?
The below figure shows the schematic diagram of an FDM system. The transmitter end
contains multiple transmitters and the receiver end contains multiple receivers. The
communication channel is present between the transmitter and receiver.
At transmitter end, each transmitter sends a signal of different frequency. In the below figure,
the transmitter 1 sends a signal of 30 kHz, transmitter 2 sends a signal of 40 kHz, and
transmitter 3 sends a signal of 50 kHz. These signals of different frequencies are then
multiplexed or combined by using a device called multiplexer. It then transmits the multiplexed
signals over a communication channel.

Figure: Frequency division multiplexing


At the receiver end, the multiplexed signals are separated by using a device called
demultiplexer. It then sends the separated signals to the respective receivers. In the above
figure, the receiver 1 receives signal of 30 kHz, receiver 2 receives signal of 40 kHz,
and receiver 3 receives signal of 50 kHz.
Advantages of FDM
 It transmits multiple signals simultaneously.
 In frequency division multiplexing, the demodulation process is easy.
 It does not need Synchronization between transmitter and receiver.
Disadvantages of FDM
 FDM technique is used only when low-speed channels are required.
 It suffers the problem of crosstalk.
 A Large number of modulators are required.
 It requires a high bandwidth channel
Applications of FDM

 FDM is commonly used in TV networks.


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

63
Wavelength multiplexing
Wavelength division multiplexing is an analog technique. It is the most important and most
popular method to increase the capacity of an optical fiber. We know that wavelength and
frequency are inversely proportional to each other (I.e. longer wavelength means low frequency
and shorter wavelength means high frequency). Therefore, the working principle of wavelength
division multiplexing is similar to frequency division multiplexing. The only difference is in
wavelength division multiplexing optical signals are used instead of electrical signals. In
wavelength division multiplexing, optical signals are transmitted through fiber optic cables.
Wavelength division multiplexing is a technology in which multiple optical signals (laser light)
of different wavelengths or colors are combined into one signal and is transmitted over the
communication channel. Thus multiple signals are transmitted simultaneously over a single
communication channel.

Figure: Wavelength Division Multiplexing


In wavelength division multiplexing, the communication channel is a fiber optic cable.
Wavelength division multiplexing is also known as WDM. A demultiplexer at the receiver end
separates the optical signal wavelengths or colors.
In this technique, the bandwidth of the communication channel should be greater than the
combined bandwidth of individual signals.
The wavelength division multiplexing divides the bandwidth of a channel into several logical
sub-channels according to its wavelength. It allots each logical sub-channel for a different light
color or optical signal wavelength. The individual signals are filtered and then modulated
(wavelength is shifted), to fit exactly into logical sub-channels.
In this technique, each logical sub-channel (individual signal wavelength) is allotted to each
user. In other words, each user owns a sub-channel.
The main advantage of WDM system is that you only need to upgrade the multiplexer and
demultiplexer at each end; you no need to buy more fibers which are more expensive.
Wavelength division multiplexing enables bi-directional communication and multiplication of
optical signal capacity.

64
How WDM Works?
The transmitter end contains multiple optical transmitters and the receiver end contains
multiple optical receivers. The communication channel (optical fiber) is present between the
transmitter and receiver. It is used to utilize the high data rate capability of fibre optic cable.

Optical signals from different source are combined to form a wider band of light with the help
of multiplexer. At the receiving end, demultiplexer separates the signals to transmit them to
their respective destinations. Multiplexing and Demultiplexing can be achieved by using a
prism.

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.

At transmitter end, each transmitter sends an optical signal of different wavelength or color.
These optical signals of different wavelengths or colors are then multiplexed or combined by
using a device called multiplexer.

Figure: Wavelength Division Multiplexing


The multiplexed signals are then transmitted over a single communication channel (optical
fiber). In between the transmitter and receiver, optical amplifiers are used to compensate the
optical signal loss caused during the transmission.
At the receiver end, the multiplexed signals are separated by using a device called
demultiplexer. The separated signals are then sent to the respective receivers.
Advantages of Wavelength Division Multiplexing
 WDM allows transmission of data in two directions simultaneously
 Low cost
 Greater transmission capacity
 High security
 Long distance communication with low signal loss

Digital Multiplexing
The process of combining multiple digital signals into one signal is called digital multiplexing.

65
Time division multiplexing
Time Division Multiplexing is a technique in which multiple signals are combined and
transmitted one after another on the same communication channel.
At the receiver side, the signals are separated and received. Each signal is received by a user at
a different time.
Time Division Multiplexing is also simply referred to as TDM. It is the digital multiplexing
technique.
In frequency division multiplexing, all signals of different frequencies are transmitted
simultaneously. But in time division multiplexing, all signals operate with the same frequency
are transmitted at different times.
In frequency division multiplexing, the sharing of a channel is done on the basis of frequency.
But in time division multiplexing, the sharing of a channel is done on the basis of time.

Figure: Time Division Multiplexing


In time division multiplexing, each user is allotted a particular time interval called time slot
during which data is transmitted. The time interval (time slot) allotted to each receiver (user)
is so small that the receiver will not detect that some time was used to serve another receiver
(user).
In time division multiplexing, all signals are not transmitted simultaneously; instead, they are
transmitted one after another. For example, as shown in the above figure, at first, we send signal
A. Then after second signal B and then after third signal C and finally, we send last signal D.
Thus, each user occupies an entire bandwidth for a short period of time.
The time division multiplexing technique is used to multiplex analog signals or digital signals.
However, the time division multiplexing is more suitable for digital signal multiplexing.
In time division multiplexing, the bandwidth capacity of the communication channel should be
greater than the multiple input signals.

66
Types of TDM
Time Division Multiplexing is mainly classified into two types:
 Synchronous TDM (Time Division Multiplexing)
 Asynchronous TDM (Time Division Multiplexing)
Synchronous TDM
In synchronous time division multiplexing, each device (transmitter) is allotted with a fixed
time slot, regardless of the fact that the device (transmitter) has any data to transmit or not. The
device has to transmit data within this time slot. If the device (transmitter) does not have any
data to send then its time slot remains empty.
As shown in the below figure, the various time slots are arranged into frames and each frame
consists of one or more time slots dedicated to each device (transmitter). For example, if there
are 3 devices, there will be 3 slots in each frame. Similarly, if there are 5 devices, there will be
5 slots in each frame.

The above figure shows 4 devices (transmitter A, transmitter B, transmitter C, and transmitter
D) that have 4 dedicated time slots (time slot A, time slot B, time slot C and time slot D). The
transmitter A data is sent at time slot A, transmitter B data is sent at time slot B, transmitter C
data is sent at time slot C and transmitter D data is sent at time slot D. In the time frame 2, the
transmitter B and C does not have any data to send so the time slot B and C remains empty.
The main drawback of synchronous time division multiplexing is that the channel capacity is
not fully utilized. Hence, the bandwidth goes wasted.
Asynchronous TDM
In Asynchronous time division multiplexing, the time slots are not fixed (I.e. time slots are
flexible). The asynchronous TDM is also known as statistical time division multiplexing.
In synchronous TDM, the number of time slots is equal to the number of devices (transmitters).
But in Asynchronous TDM, the number of time slots is not equal to the number of devices
(transmitters). The time slots in asynchronous TDM are always less than the number of devices
(transmitter). For example, if we have X devices and Y time slots. Y should always be less than
X (I.e. Y < X).

67
In asynchronous time division multiplexing, time slots are not fixed to a particular device;
instead, they are allotted to any of the devices that have data to send.
In the above figure, it is shown that the number of devices are 4 and time slots are 3. The
timeframe 1 (all slots) is completely filled with data from devices A, B, and C. The timeframe
1 has only 3 time-slots. So the data from device D is filled in the next timeframe (I.e. timeframe
2) in timeslot 1. The data from devices A and D will be filled in timeslots 2 and 3 in timeframe
2.
In asynchronous time division multiplexing, the multiplexer scans all the devices (transmitters)
and accepts input only from the devices that have actual data to send and fills all the frames,
and then sends it to the receiver.
If there is not enough data to fill all the slots in a frame, then the partially filled frames are
transmitted. In most of the cases, all the time slots in frames are completely filled.
Advantages of TDM
1. Full bandwidth is utilized by a user at a particular time.
2. The time division multiplexing technique is more flexible than frequency division
multiplexing.
3. In time division multiplexing, the problem of crosstalk is very less.
Disadvantages of TDM

1. In time division multiplexing, synchronization is required.

68
Difference between FDM and TDM
FDM TDM

1. Each sending device produces signals 1. Each frame consists of a set of time slots,
which modulate at distinct carrier and portions of each source is assigned a
frequencies. time slot per frame.
2. It is preferred for analog signal. 2. It is preferred for digital signal.
3. Synchronization is not required 3. Synchronization is required.
4. FDM circuitry is very complex. 4. TDM circuitry is very simple to build.
5. FDM suffers from the Cross Talk 5. TDM is not sensitive for Cross Talk
immunity due to band pass filter. (Noise immunity)
6. FDM requires guard band for its 6. TDM requires syn pulse for its operations
operations.
7. FDM is less efficient compared to TDM. 7. TDM is more efficient and widely used
technique in multiplexing.
8. FDM is used in TV and radio 8. TDM is used in pulse code modulation.
broadcasting.

Spread Spectrum Techniques

• Spread-Spectrum techniques are methods by which a signal (e.g. an electrical,


electromagnetic, or acoustic signal) generated with a particular bandwidth is
deliberately spread in the frequency domain, resulting in a signal with a wider
bandwidth.
• These techniques are used for a variety of reasons, including the establishment of
secure communications, increasing resistance to natural interference, noise and
jamming, to prevent detection, and to limit power flux density (e.g. in satellite
downlinks).
• Spread spectrum is designed to be used in wireless applications (LANs and WANs).
In wireless applications, all stations use air (or a vacuum) as the medium for
communication. Stations must be able to share this medium without interception by an
eavesdropper and without being subject to jamming from a malicious intruder.
• To achieve these goals, spread spectrum techniques add redundancy, they spread the
original spectrum needed for each station. If the required bandwidth for each station is
B, spread spectrum expands it to Bss such that Bss >> B. The expanded bandwidth
allows the source to wrap its message in a protective envelope for a more secure
transmission.

69
There are two techniques to spread the bandwidth:

Frequency Hopping Spread Spectrum (FHSS)

 The Frequency Hopping Spread Spectrum (FHSS) technique uses M different carrier
frequencies that are modulated by the source signal.
 The bandwidth occupied by a source after spreading is BpHSS >> B.
 The following figure shows the general layout for FHSS. A pseudorandom code
generator, called pseudorandom noise (PN), creates a k-bit pattern for every hopping
period.

For Example M is 8 and k is 3. The pseudorandom code generator will create eight different
3-bit patterns.
These are mapped to eight different frequencies in the frequency table as shown in the
following figure.

70
The pattern for this station is 101, 111, 001, 000, 010, all, 100. Note that the pattern is
pseudorandom it is repeated after eight hoppings. This means that at hopping period 1, the
pattern is 101. The frequency selected is 700 kHz, the source signal modulates this carrier
frequency.

The second k-bit pattern selected is 111, which selects the 900-kHz carrier; the eighth pattern
is 100, the frequency is 600 kHz. After eight hoppings, the pattern repeats, starting from 101
again.

Bandwidth Sharing
If the number of hopping frequencies is M, we can multiplex M channels into one by using the
same Bss bandwidth.

Direct Sequence Spread Spectrum (DSSS)


The direct sequence spread spectrum (DSSS) technique also expands the bandwidth of the
original signal, but the process is different. In DSSS, we replace each data bit with n bits using
a spreading code. In other words, each bit is assigned a code of n bits, called chips, where the
chip rate is n times that of the data bit.

In the figure, the spreading code is 11 chips having the pattern 10110111000 (in this case). If
the original signal rate is N, the rate of the spread signal is 11N. This means that the required
bandwidth for the spread signal is 11 times larger than the bandwidth of the original signal.

71
Switching
Switching is the technique by which nodes control or switch data to transmit it between specific
points on a network. It defines the connection technique between sender and receiver along
with format of data used during communication.
Types of switching
2. Circuit switching
Circuit-switching is the real-time connection-oriented system. In Circuit Switching a
dedicated channel (or circuit) is set up for a single connection between the sender and
recipient during the communication session. In telephone communication system, the
normal voice call is the example of Circuit Switching. The telephone service provider
maintain a unbroken link for each telephone call. Circuit switching is pass through three
phases that are circuit establishment, data transfer and circuit disconnect.

Figure: Circuit switching


Advantages of Circuit Switching:

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


 It has fixed bandwidth.

72
Disadvantages of Circuit Switching:

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

3. Message switching
Message Switching is a switching technique in which a message is transferred as a complete
unit and routed through intermediate nodes. In this method, if a station wishes to send a
message to another station, it first appends the destination address to the message. After this,
the message is transmitted from the source to its destination either by store and forward or
broadcast method.

In store and forward method, the message is transmitted from the source node to an
intermediate node. The intermediate node stores the complete message temporarily, inspects it
for errors, and transmits it to the next node, based on an available free channel and its routing
information. The actual path taken by the message to its destination is dynamic, because the
path is established as it travels along. When the message reaches a node, the channel on which
it came is released for use by another message.

Figure: Message Switching

In the broad cast method, the message is broadcast over a common medium, which is known
as broadcast channel. All the stations check the destination address of each message as they

73
pass by, and accept only those addressed to them. The routing delays inherent in store and
forward method are eliminated in this method.

Advantages of Message Switching

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

Disadvantages of Message Switching

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

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

Figure: Packet switching

74
Advantages of Packet Switching:

 Cost-effective: In packet switching technique, switching devices do not require massive


secondary storage to store the packets, so cost is minimized to some extent. Therefore, we
can say that the packet switching technique is a cost-effective technique.
 Reliable: If any node is busy, then the packets can be rerouted. This ensures that the Packet
Switching technique provides reliable communication.
 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.

Disadvantages of Packet Switching:

 Packet Switching technique cannot be implemented in those applications that require low
delay and high-quality services.
 The protocols used in a packet switching technique are very complex and requires high
implementation cost.
 If the network is overloaded or corrupted, then it requires retransmission of lost packets. It
can also lead to the loss of critical information if errors are nor recovered.

Telephone Network
Telephone networks use circuit switching. The telephone network had its beginnings in the
late 1800s. The entire network, which is referred to as the plain old telephone system
(POTS), was originally an analog system using analog signals to transmit voice.

Figure: A Telephone System


The tasks of data transfer and signalling are separated in modern telephone network: data
transfer is done by one network, signalling by another.

75
Figure: Data Transfer and Signalling networks
Modem stands for modulator/demodulator.

Figure: Modulation/Demodulation
After traditional modems reached their peak data rate, telephone companies developed another
technology, technology, DSL, to provide higher-speed access to the Internet. Digital
subscriber line (DSL) technology is one of the most promising for supporting high-speed
digital communication over the existing local loops.

Cable Networks
 The cable network started as a video service provider, but it has moved to the business of
Internet access. This network can be used to provide high -speed access to the Internet.
 Cable television, generally, any system that distributes television signals by means of
coaxial or fibre optic cables. The term also includes systems that distribute signals solely
via satellite.
 Cable-television systems originated in the United States in the late 1940s and were designed
to improve reception of commercial network broadcasts in remote and hilly areas.
 During the 1960s they were introduced in many large metropolitan areas where local
television reception is degraded by the reflection of signals from tall buildings.
 Commonly known as community antenna television (CATV), these cable systems use a
“community antenna” to receive broadcast signals (often from communications satellites),
which they then retransmit via cables to homes and establishments in the local area
subscribing to the service.

76
1. Traditional Cable Networks

Communication in the traditional cable TV network is unidirectional.

Figure: Traditional cable TV network

2. Hybrid Fiber-coaxial (HFC) Network

Communication in an HFC cable TV network can be bidirectional.

Figure: Hybrid Fiber-coaxial (HFC) Network

Mobile
Mobile Data is the term used by many to describe the use of wireless data communications
using radio waves to send and receive information. This is part of the much broader mobile
technology arena.

Benefits of using mobile data communications

Mobile Data technology lets your key staff operate more efficiently when they are out of the
office. It can help you:

77
• Carry out tasks remotely, which would normally be done on a computer in the office,
• Communicate with people at remote locations,
• Work with data that is held in the office, even when you are in a different location,
• Communicate a message
• Create an electronic audit trail of messages sent/received
• Keep in touch with the office anytime and from anywhere.

Choosing the appropriate mobile data technology

The technology choices are many and varied and can be divided into two main categories

• The choice of wireless data network


• The type of device
Wireless data networks exist in such number and variety as to be difficult to categories and
compare.

Some wireless data networks run over wireless voice networks, such as mobile telephone
networks. GPRS, 3G, 4G and 5G are examples.

There are cost implications on the type of data network you use for your mobile data solution.
The variables involved in calculating the data transmission costs include;

• The amount of data to be transmitted


• The frequency of the data transmissions
• The type of connection, e.g. permanent always on or occasional - as and when needed.

GSM

GSM stands for Global System for Mobile communications. GSM is one of the most widely
used digital wireless telephony system.
GSM technology uses TDMA (Time Division Multiple Access) to support up to eight calls
simultaneously. It also uses encryption to make the data more secure.
The frequencies used by the international standard is 900 MHz to 1800 MHz However, GSM
phones used in the US use 1900 MHz frequency and hence are not compatible with the
international system.
CDMA

CDMA stands for Code Division Multiple Access. It was first used by the British military
during World War II. After the war its use spread to civilian areas due to high service quality
WLL. WLL stands for Wireless in Local Loop. It is a wireless local telephone service that can
be provided in homes or offices.

78
GPRS

GPRS stands for General Packet Radio Services. It is a packet based wireless communication
technology that charges users based on the volume of data they send rather than the time
duration for which they are using the service.

GPRS is the mobile communication protocol used by second (2G) and third generation (3G)
of mobile telephony. It pledges a speed of 56 kbps to 114 kbps, however the actual speed may
vary depending on network load.
3G – Third Generation
3G came in early 2000, which can provide voice, video call, and fast data. With several
additions of technology, 3G can even offer up to 42 Mbps speed. But a customer gets
around 4 to 7 Mbps on average.
4G – Fourth Generation
4G is a very different technology as compared to 3G and was made possible practically only
because of the advancements in the technology in the last 10 years. Its purpose is to
provide high speed, high quality and high capacity to users while improving security and lower
the cost of voice and data services, multimedia and internet over IP. Potential and current
applications include amended mobile web access, IP telephony, gaming services, high-
definition mobile TV, video conferencing, 3D television, and cloud computing.
5G – Fifth Generation
5G is a generation currently under development, that's intended to improve on
4G. 5G promises significantly faster data rates, higher connection density, much lower latency,
among other improvements. Some of the plans for 5G include device-to-
device communication, better battery consumption, and improved overall wireless coverage.
The max speed of 5G is aimed at being as fast as 35.46 Gbps , which is over 35 times faster
than 4G.

79
Unit-3
The Data Link Layer
The Data Link Layer is the second layer in the OSI model, above the Physical Layer, which
ensures that the error free data is transferred between the adjacent nodes in the network. It
breaks the datagrams passed down by above layers and convert them into frames ready for
transfer.

Sublayers of data link layer

Data Link Layer has two sublayers,

1. Logical Link Control (LLC):


This is the uppermost sub-layer, LLC consists of protocols running at the top of the data
link layer, and also provides flow control, acknowledgment, and error notification. The
LLC provides addressing and data link control. It specifies which methods are to be
used for addressing channels over the transmission medium and for controlling the data
exchanged between the generator of packet and recipient of the message.

2. Media Access Control (MAC):

Who can access the media at any one time, determines by the MAC sublayer (e.g.
CSMA/CD). The packet obtains from the Network layer is further divided into frames
depending on the frame size of NIC (Network Interface Card). DLL also encases
Sender's and Receiver's MAC address in the header. An ARP (Address Resolution
Protocol) request is placed onto the wire asking "Who has that IP address?" and after
getting this message destination host replies with its MAC address. By this, the
receiver's MAC address is obtained.

Functions of data link layer

1. Framing: The data link layer receives the stream of bits from the network layer
divides into manageable data units called frames.
80
The data link layer, needs to pack bits into frames, so that each frame is distinguishable
from another. The Data Link layer prepares a packet for transport across the local media
by encapsulating it with a header and a trailer to create a frame. The Data Link layer
frame includes:

• Data - The packet from the Network layer.


• Header - Contains control information, such as addressing, and is located at the
beginning of the PDU.
• Trailer - Contains control information added to the end of the PDU

Parts of a frame

1. Frame Header − It contains the source and the destination addresses of the
frame.
2. Payload field − It contains the message to be delivered.
3. Trailer − It contains the error detection and error correction bits. •

4. Flag − It marks the beginning and end of the frame.

2. Physical addressing: If frames are to be distributed to different stations on the network.


To define the physical address of the sender (source address) and/or receiver
(destination address) of the frame, the DLL adds a header to the frame. If the frame is
to be sent for a system outside the sender's network. The receiver's address means the
address of the device that connects one network to the another.
3. Flow control: If the rate at which the data are consumed by the receiver is less than
the rate produced by the sender, the data link layer deals with a flow control
mechanism to prevent overrun the receiver.
4. Error control: The data link layer also deals with damaged or lost frames. By adding
mechanisms to detect and retransmit lost frames increases reliability. A trailer added
to the end of the frame to achieve error control.
5. Access control: When more than two or two devices are connected to the common
link, data link layer protocols are necessary to determine which device has control
over the link at any point of time.

81
Framing methods

1. Character count
This method uses a field in the header to specify the number of characters in the frame.
When the data link layer at the destination sees the character count, it knows how many
characters follow, and hence where the end of the frame is. The disadvantage is that if the
count is garbled by a transmission error, the destination will lose synchronization and will
be unable to locate the start of the next frame. So, this method is rarely used.

2. Starting and Ending characters with Character Stuffing


In the second method, each frame starts with the ASCII character sequence DLE STX and
ends with the sequence DLE ETX.(where DLE is Data Link Escape, STX is Start of TeXt
and ETX is End of TeXt.) This method overcomes the drawbacks of the character count
method. If the destination ever loses synchronization, it only has to look for DLE STX and
DLE ETX characters. If however, binary data is being transmitted then there exists a
possibility of the characters DLE STX and DLE ETX occurring in the data. Since this can
interfere with the framing, a technique called character stuffing is used. The sender's data
link layer inserts an ASCII DLE character just before the DLE character in the data. The
receiver's data link layer removes this DLE before this data is given to the network layer.
However character stuffing is closely associated with 8-bit characters and this is a major
hurdle in transmitting arbitrary sized characters.

82
Fig: (a) Data sent by the network layer. (b) Data after being character stuffed by the data
link layer. (c) Data passed to the network layer on the receiving side.

Figure: character stuffing


3. Starting and Ending flags, with Bit Stuffing
The third method allows data frames to contain an arbitrary number of bits and allows
character codes with an arbitrary number of bits per character. At the start and end of each
frame is a flag byte consisting of the special bit pattern 01111110. Whenever the sender's
data link layer encounters five consecutive 1s in the data, it automatically stuffs a zero bit
into the outgoing bit stream. This technique is called bit stuffing. When the receiver sees
five consecutive 1s in the incoming data stream, followed by a zero bit, it automatically de-
stuffs the 0 bit. The boundary between two frames can be determined by locating the flag
pattern.

83
4. Physical layer Coding Violations
The final framing method is physical layer coding violations and is applicable to networks
in which the encoding on the physical medium contains some redundancy. In such cases
normally, a 1 bit is a high-low pair and a 0 bit is a low-high pair. The combinations of low-
low and high-high which are not used for data may be used for marking frames boundaries.

Figure: Physical Layer coding violation


Flow control
Flow control is a technique that allows two stations working at different speeds to
communicate with each other. It is a set of measures taken to regulate the amount of data
that a sender sends so that a fast sender does not overwhelm a slow receiver. In data link
layer, flow control restricts the number of frames the sender can send before it waits for an
acknowledgment from the receiver.

Approaches of Flow Control


Flow control can be broadly classified into two categories −

84
 Feedback based Flow Control In these protocols, the sender sends frames after it has
received acknowledgments from the user. This is used in the data link layer.
 Rate based Flow Control These protocols have built in mechanisms to restrict the rate of
transmission of data without requiring acknowledgment from the receiver. This is used in
the network layer and the transport layer.
Flow control Techniques

1. Stop-and-Wait Flow Control:

This method is the easiest and simplest form of flow control. In this method, basically
message or data is broken down into various multiple frames, and then receiver indicates its
readiness to receive frame of data. When acknowledgment is received, then only sender will
send or transfer the next frame.

85
This process is continued until sender transmits EOT (End of Transmission) frame. In this
method, only one of frames can be in transmission at a time. It leads to inefficiency i.e. less
productivity if propagation delay is very much longer than the transmission delay.
Advantages –
 This method is very easiest and simple and each of the frames is checked and
acknowledged well.
 It can also be used for noisy channels.
 This method is also very accurate.
Disadvantages –
 This method is fairly slow.
 In this, only one packet or frame can be sent at a time.
 It is very inefficient and makes the transmission process very slow.

2. Sliding window flow control


This method is required where reliable in-order delivery of packets or frames is very much
needed like in data link layer. It is point to point protocol that assumes that none of the other
entity tries to communicate until current data or frame transfer gets completed. In this
method, sender transmits or sends various frames or packets before receiving any
acknowledgment.
In this method, both the sender and receiver agree upon total number of data frames after
which acknowledgment is needed to be transmitted. Data Link Layer requires and uses this
method that simply allows sender to have more than one unacknowledged packet “in-flight”
at a time. This increases and improves network throughput.
Sender window

 At the beginning of a transmission, the sender window contains n-1 frames, and when
they are sent out, the left boundary moves inward shrinking the size of the window. For
example, if the size of the window is w if three frames are sent out, then the number of
frames left out in the sender window is w-3.
 Once the ACK has arrived, then the sender window expands to the number which will
be equal to the number of frames acknowledged by ACK.
 For example, the size of the window is 7, and if frames 0 through 4 have been sent out
and no acknowledgement has arrived, then the sender window contains only two
frames, i.e., 5 and 6. Now, if ACK has arrived with a number 4 which means that 0
through 3 frames have arrived undamaged and the sender window is expanded to
include the next four frames. Therefore, the sender window contains six frames
(5,6,7,0,1,2).

86
Receiver Window

 At the beginning of transmission, the receiver window does not contain n frames, but it
contains n-1 spaces for frames.
 When the new frame arrives, the size of the window shrinks.
 The receiver window does not represent the number of frames received, but it represents
the number of frames that can be received before an ACK is sent. For example, the size
of the window is w, if three frames are received then the number of spaces available in
the window is (w-3).
 Once the acknowledgement is sent, the receiver window expands by the number equal
to the number of frames acknowledged.
 Suppose the size of the window is 7 means that the receiver window contains seven
spaces for seven frames. If the one frame is received, then the receiver window shrinks
and moving the boundary from 0 to 1. In this way, window shrinks one by one, so
window now contains the six spaces. If frames from 0 through 4 have sent, then the
window contains two spaces before an acknowledgement is sent.

Advantages –
 It performs much better than stop-and-wait flow control.

87
 This method increases efficiency.
 Multiples frames can be sent one after another.
Disadvantages –
 The main issue is complexity at the sender and receiver due to the transferring of
multiple frames.
 The receiver might receive data frames or packets out the sequence.
Error control
Error Control is a technique of error detection and retransmission.

1. Stop and wait


In Stop and Wait retransmission strategy, Sender keeps a copy of the last frame until it
receives an acknowledgement. For identification, both data frames and acknowledgements
(ACK) frames are numbered alternatively 0 and 1.
Sender has a control variable (S) that holds the number of the recently sent frame (i.e. 0 or
1). Receiver has a control variable (R) that holds the number of the next frame expected
(i.e. 0 or 1). Sender starts a timer when it sends a frame. If an ACK is not received within
an allocated time period, the sender assumes that the frame was lost or damaged and resends
it. Receiver send only positive ACK if the frame is intact. ACK number always defines the
number of the next expected frame.

88
Stop-and-Wait ARQ(Automatic-Repeat-Request), lost frame:

When a receiver receives a damaged frame, it discards it and keeps its value of R. After the
timer at the sender expires, another copy of frame 1 is sent.

Stop-and-Wait, lost ACK:

If the sender receives a damaged ACK, it discards it. When the timer of the sender expires,
the sender retransmits frame 1. Receiver has already received frame 1 and expecting to
receive frame 0 (R=0). Therefore it discards the second copy of frame 1.

89
Stop-and-Wait, delayed ACK frame:

The ACK can be delayed at the receiver or due to some problem. It is received after the timer
for frame 0 has expired. Sender retransmitted a copy of frame 0. However, R =1 means receiver
expects to see frame 1. Receiver discards the duplicate frame 0. Sender receives 2 ACKs, it
discards the second ACK.

90
Piggybacking:

A method to combine a data frame with ACK. Station A and B both have data to send. Instead
of sending separately, station A sends a data frame that includes an ACK. Station B does the
same thing. Piggybacking saves bandwidth.

Disadvantages of stop and wait

 It works fine only for noiseless channels.


 It works on assumption that there is no delay in the network which is mostly in
applicable.
 It considers queuing delay to be 0, which is not true in case of internet.
 Transmission of packet using this protocol is very slow.
 If any how the acknowledgement is not received by the sender it will keep waiting
for long time.
 It is not useful for wide area network.

2. Go-Back-N ARQ:
We can send up to W frames before worrying about ACKs. We keep a copy of these frames
until the ACKs arrive. This procedure requires additional features to be added to Stop-and-
Wait ARQ.
Sequence Numbers:

Frames from a sender are numbered sequentially. We need to set a limit since we need to
include the sequence number of each frame in the header. If the header of the frame allows

91
m bits for sequence number, the sequence numbers range from 0 to 2m – 1. For example:
m = 3, sequence numbers are: 1, 2, 3, 4, 5, 6, 7. we can repeat the sequence number.
Sequence numbers are: 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1 …

Sender Sliding Window:

At the sending side, to hold the outstanding frames until they are acknowledged, we use
the concept of a window. The size of the window is at most 2m - 1 where m is the number
of bits for the sequence number. Size of the window can be variable, e.g. TCP. The window
slides to include new unsent frames when the correct ACKs are received.

Receiver Sliding Window:

Size of the window at the receiving site is always 1 in this protocol. Receiver is always looking
for a specific frame to arrive in a specific order. Any frame arriving out of order is discarded
and needs to be resent. Receiver window slides as shown in fig. Receiver is waiting for frame
0 in part a.
Control Variables:

Sender has 3 variables: S, SF, and SL. S holds the sequence number of recently sent frame. SF
holds the sequence number of the first frame. SL holds the sequence number of the last frame.
Receiver only has the one variable, R that holds the sequence number of the frame it expects
to receive. If the sequence number is the same as the value of R, the frame is accepted,
otherwise rejected.

92
Acknowledgement:

Receiver sends positive ACK if a frame arrived safe and in order. If the frames are damaged/out
of order, receiver is silent and discard all subsequent frames until it receives the one it is
expecting. The silence of the receiver causes the timer of the unacknowledged frame to expire.
Then the sender resends all frames, beginning with the one with the expired timer.
For example, suppose the sender has sent frame 6, but the timer for frame 3 expires (i.e. frame
3 has not been acknowledged), then the sender goes back and sends frames 3, 4, 5, 6 again.
Thus it is called Go-Back-N-ARQ. The receiver does not have to acknowledge each frame
received, it can send one cumulative ACK for several frames.
Go-Back-N ARQ, Normal Operation:

The sender keeps track of the outstanding frames and updates the variables and windows as the
ACKs arrive.

Go-Back-N ARQ, Lost Frame:

93
Frame 2 is lost. When the receiver receives frame 3, it discards frame 3 as it is expecting frame
2 (according to window). After the timer for frame 2 expires at the sender site, the sender sends
frame 2 and 3. (Go back to 2)

Go-Back-N ARQ, Damaged/Lost/Delayed ACK:

If an ACK is damaged/lost, we can have two situations:


If the next ACK arrives before the expiration of any timer, there is no need for retransmission
of frames because ACKs are cumulative in this protocol.
If ACK1, ACK2, and ACk3 are lost, ACK4 covers them if it arrives before the timer expires.
If ACK4 arrives after time-out, the last frame and all the frames after that are resent. Receiver
never resends an ACK. A delayed ACK also triggers the resending of frames.
Go-Back-N ARQ, Sender Window Size:

Size of the sender window must be less than 2 m. Size of the receiver is always 1. If m = 2,
window size=2m -1=3. Fig compares a window size of 3 and 4.

94
3. Selective Repeat ARQ:
Go-Back-N ARQ simplifies the process at the receiver site. Receiver only keeps track of only
one variable, and there is no need to buffer out-of-order frames, they are simply discarded.
Here, Selective Repeat ARQ, holds control variables SF, S & SL at sender and RF & RL at
receiver sites. However, Go-Back-N ARQ protocol is inefficient for noisy link. Its bandwidth
inefficient and slows down the transmission. In Selective Repeat ARQ, only the damaged frame
is resent. More bandwidth efficient but more complex processing at receiver. It defines a
negative ACK (NAK) to report the sequence number of a damaged frame before the timer
expires.

Selective Repeat ARQ, Lost Frame:

Frames 0 and 1 are accepted when received because they are in the range specified by the
receiver window. Same for frame 3. Receiver sends a NAK2 to show that frame 2 has not been
received and then sender resends only frame 2 and it is accepted as it is in the range of the
window.

95
Selective Repeat ARQ, Sender Window Size:

Size of the sender and receiver windows must be at most one-half of 2m. If m = 2, window size
should be 2m/2 = 2. Fig compares a window size of 2 with a window size of 3. Window size is
3 and all ACKs are lost, sender sends duplicate of frame 0, window of the receiver expect to
receive frame 0 (part of the window), so accepts frame 0, as the 1st frame of the next cycle an
error.

96
Basics of Error Detection and Correction
Error is a condition when the output information does not match with the input information.
There can be various reasons that the transmission error occurs. Possible causes are noises,
attenuation, distortion, crosstalk, losing synchronization, etc. We thus need to detect the errors
that occurred and proceed for its correction.
Digital signals suffer from noise that can introduce errors in the binary bits travelling from one
system to other. That means a 0 bit may change to 1 or a 1 bit may change to 0. The errors are
mainly of two types: single bit error or multiple bits i.e. burst error.

 Single bit error means only one bit of data unit is changed from 1 to 0 or from 0 to 1.
 Burst Error means two or more bits in data unit are changed from 1 to 0 from 0 to 1
as shown in figures below.

Process of Error Detection

The basic strategies for dealing with errors are Error Detection Codes and Error Correcting
Codes.
Error Detecting Codes
Whenever a message is transmitted, it may get scrambled by noise, or the data may get
corrupted. Error-detecting codes which are additional data added to a given digital message to

97
help us detect if an error occurred during transmission of the message. Parity Check, which
is referred for channels that are highly reliable, such as fiber. Cheaper to use and it just
retransmit the occasional block found to be faulty. Other examples are Checksum and Cyclic
Redundancy Check (CRC).
a. Parity Check
It is the simplest technique for detecting and correcting errors. The MSB of an 8-bits
word is used as the parity bit and the remaining 7 bits are used as data or message bits.
The parity of 8-bits transmitted word can be either even parity or odd parity.

 Even bit parity: Even parity means the number of 1's in the given word including
the parity bit should be even (i.e. 2, 4, 6 ...).
 Odd parity: Odd parity means the number of 1's in the given word including the
parity bit should be odd (i.e. 1, 3, 5 ...).

Then, the parity bit can be set to 0 or 1 depending on the type of the parity required.
For even parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the entire word is
even as shown in fig. (a).
For odd parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the entire word is
odd. Shown in fig. (b).

Parity checking at the receiver can detect the presence of an error if the parity of the receiver
signal is different from the expected parity. That means, if it is known that the parity of the
transmitted signal is always going to be "even" and if the received signal has an odd parity,
then the receiver can conclude that the received signal is not correct. If an error is detected,
then the receiver will ignore the received byte and request for retransmission of the same byte
to the transmitter. This scheme can detect only single bits. So if two or more bits are changed
then that cannot be detected.

98
b. Vertical Redundancy checksum
Vertical redundancy check (VRC) is an error-checking method used on an eight-bit ASCII
character. In VRC, a parity bit is attached to each byte of data, which is then tested to
determine whether the transmission is correct. VRC is considered an unreliable error-
detection method because it only works if an even number of bits is distorted. A vertical
redundancy check is also called a transverse redundancy check when used in combination
with other error-controlling codes such as a longitudinal redundancy check.
VRC is a redundancy check meant for parallel synchronized bits applied one bit at a time.
It uses additional parallel channels for check bits and refers to single-parity bits or larger
hamming codes. Although parities are only meant for error detection and not error
correction, they still can remain part of a system for correcting errors.

c. Longitudinal Redundancy Checksum


Longitudinal Redundancy Checksum is an error detecting scheme which overcomes the
problem of two erroneous bits. In this concept of parity bit is used but with slightly
more intelligence. With each byte we send one parity bit then send one additional byte
which have the parity corresponding to the each bit position of the sent bytes. So the
parity bit is set in both horizontal and vertical direction. If one bit get flipped we can
tell which row and column have error then we find the intersection of the two and
determine the erroneous bit. If 2 bits are in error and they are in the different column
and row then they can be detected. If the error are in the same column then the row will

99
differentiate and vice versa. Parity can detect the only odd number of errors. If they are
even and distributed in a fashion that in all direction then LRC may not be able to find
the error

d. Checksum
In checksum error detection scheme, the data is divided into k segments each of m bits.
In the sender’s end the segments are added using 1’s complement arithmetic to get the
sum. The sum is complemented to get the checksum. The checksum segment is sent
along with the data segments. At the receiver’s end, all received segments are added
using 1’s complement arithmetic to get the sum. The sum is complemented. If the result
is zero, the received data is accepted; otherwise discarded.

e. Cyclic Redundancy Check


Cyclic Redundancy Check (CRC) an error detection mechanism in which a special
number is appended to a block of data in order to detect any changes introduced during

100
storage (or transmission). The CRC is recalculated on retrieval (or reception) and
compared to the value originally transmitted, which can reveal certain types of error.
For example, a single corrupted bit in the data results in a one-bit change in the
calculated CRC, but multiple corrupt bits may cancel each other out.
CRC is more powerful than VRC and LRC in detecting errors. It is not based on binary
addition like VRC and LRC. Rather it is based on binary division. At the sender side,
the data unit to be transmitted IS divided by a predetermined divisor (binary number)
in order to obtain the remainder. This remainder is called CRC.
The CRC has one bit less than the divisor. It means that if CRC is of n bits, divisor is
of n+ 1 bit. The sender appends this CRC to the end of data unit such that the resulting
data unit becomes exactly divisible by predetermined divisor i.e. remainder becomes
zero. At the destination, the incoming data unit i.e. data + CRC is divided by the same
number (predetermined binary divisor).
If the remainder after division is zero then there is no error in the data unit & receiver
accepts it. If remainder after division is not zero, it indicates that the data unit has been
damaged in transit and therefore it is rejected. This technique is more powerful than the
parity check and checksum error detection. CRC is based on binary division. A
sequence of redundant bits called CRC or CRC remainder is appended at the end of a
data unit such as byte.
The various steps followed in the CRC method are:
 A string of n 0’s is appended to the data unit. The length of predetermined divisor
is n+ 1.
 The newly formed data unit i.e. original data + string of n 0’s are divided by the
divisor using binary division and remainder is obtained. This remainder is called
CRC.
 Now, string of n 0’s appended to data unit is replaced by the CRC remainder (which
is also of n bit).
 The data unit + CRC is then transmitted to receiver.
 The receiver on receiving it divides data unit + CRC by the same divisor & checks
the remainder.
 If the remainder of division is zero, receiver assumes that there is no error in data
and it accepts it.
 If the remainder is non zero then there is an error in data and receiver rejects it.

101
For example, if data to be transmitted is 1001 and predetermined divisor is 1011. The procedure
given below is used.

 String of 3 zeroes is appended to 1011 as divisor is of 4 bits. Now newly formed


data is 1011000.
 Data unit 1011000 is divided by 1011.
 During this process of division, whenever the leftmost bit of dividend or remainder
is 0, we use a string of O’s of same length as divisor. Thus in this case divisor 1011
is replaced by 0000.
 At the receiver side, data received is 1001110.
 This data is again divided by a divisor 1011.
 The remainder obtained is 000; it means there is no error.

102
CRC can detect all the burst errors that affect an odd number of bits. The probability of error
detection and the types of detectable errors depends on the choice of divisor. Thus two major
requirement of CRC are:
 CRC should have exactly one bit less than divisor.
 Appending the CRC to the end of the data unit should result in the bit sequence which is
exactly divisible by the divisor.
Polynomial codes
A pattern of 0’s and 1’s can be represented as a polynomial with coefficient of 0 and 1. Here,
the power of each term shows the position of the bit and the coefficient shows the values of the
bit. For example, if binary pattern is 100101, its corresponding polynomial representation is x 5
+ x2 + 1. Figure shows the polynomial where all the terms with zero coefficient are removed
and xJ is replaced by x and X0 by 1.

The benefits of using polynomial codes is that it produces short codes. For example here a 6-
bit pattern is replaced by 3 terms.
 In polynomial codes, the degree is 1 less than the number of bits in the binary pattern.
The degree of polynomial is the highest power in polynomial. For example as shown in
fig degree of polynomial x5 +x2 + 1 are 5. The bit pattern in this case is 6.
 Addition of two polynomials is based on modulo-2 method. In such as case, addition
and subtraction is same.

103
 Addition or subtraction is done by combining terms and deleting pairs of identical
terms. For example adding x5 + x4 + x2 and x6 + x4 + x2 give x6 + x5. The terms x4 and
x2 are deleted.
 If three polynomials are to be added and if we get a same term three times, a pair of
them is detected and the third term is kept. For example, if there is x 2 three times then
we keep only one x2

In case of multiplication of two polynomials, their powers are added. For example,
multiplying x5 + x3 + x2 + x with x2+ x+ 1 yields:
(x5 + x3 + x2 + x) (x2 + x + 1)
= x7 + x6+ x5+ x5+ x4+ x3+ x4+ x3+ x2+ x3+ x2+ x
=x7+x6+x3+x
In this, first polynomial is multiplied by all terms of second. The result is then simplified and
pairs of equal terms are deleted. In case of division, the two polynomials are divided as per the
rules of binary division, until the degree of dividend is less than that of divisor.
CRC generator using polynomials

If we consider the data unit 1001 and divisor or polynomial generator 1011 their polynomial
representation is:

Now string of n 0’s (one less than that of divisor) is appended to data. Now data is 1001000
and its corresponding polynomial representation is x6 + x3. The division of x6+x3 by x3+x+ 1
is shown in figure.

The polynomial generator should have following properties:


 It should have at least two terms.
 The coefficient of the term x0 should be 1.
 It should not be divisible by x. It should be divisible by x+ 1.

104
There are several different standard polynomials used by popular protocols for CRC
generation. These are:

Error Correcting Codes


Technique that is preferred for channels such as wireless (less reliable) links that make many
errors, it is better to add enough redundancy to each block for the receiver to be able to figure
out what the original block was, rather than relying on a retransmission, which itself may be in
error. It also deploys the same strategy as error-detecting codes but additionally, such codes
also detect the exact location of the corrupt bit. Once the corrupted bit is located, its value is
reverted (from 0 to 1 or 1 to 0) to get the original message. One of the common techniques for
error detection and correction is the use of Parity bit.
Examples:

 Hamming Codes
 Binary Convolutional codes
 Reed-Solomon codes
 Low-Density Parity Check codes

Hamming codes

Hamming code is a set of error-correction codes that can be used to detect and correct the
errors that can occur when the data is moved or stored from the sender to the receiver. It
is technique developed by R.W. Hamming for error correction. Hamming code can be applied
to data units of any length and uses the relationship between the data bits and redundant bits.
Redundant bits are extra binary bits that are generated and added to the information-carrying
bits of data transfer to ensure that no bits were lost during the data transfer.

Figure: Position of Redundant bits in hamming code

105
Figure: Use of Hamming code for error correction for a 4-bit data
First r1 (0) is calculated considering the parity of the bit positions, 1, 3, 5 and 7. Then the parity
bits r2 is calculated considering bit positions 2, 3, 6 and 7. Finally, the parity bits r4 is calculated
considering bit positions 4, 5, 6 and 7 as shown. If any corruption occurs in any of the
transmitted code 1010010, the bit position in error can be found out by calculating r4r2r1 at the
receiving end. For example, if the received code word is 1110010, the recalculated the
recalculated value of r4r2r1 is 110, which indicates that bit position in error is 6, the decimal
value of 110.

High Level Data Link Control (HDLC)


High-level Data Link Control (HDLC) is a group of communication protocols of the data link
layer for transmitting data between network points or nodes. Since it is a data link protocol,
data is organized into frames. A frame is transmitted via the network to the destination that
verifies its successful arrival. It is a bit - oriented protocol that is applicable for both point - to
- point and multipoint communications.
HDLC supports two types of transfer modes, normal response mode and asynchronous
balanced mode.

106
 Normal Response Mode (NRM) − Here, two types of stations are there, a primary station
that send commands and secondary station that can respond to received commands. It is
used for both point - to - point and multipoint communications.

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

HDLC Frame
HDLC is a bit - oriented protocol where each frame contains up to six fields. The structure
varies according to the type of frame. The fields of a HDLC frame are −
 Flag − It is an 8-bit sequence that marks the beginning and the end of the frame. The
bit pattern of the flag is 01111110.
 Address − It contains the address of the receiver. If the frame is sent by the primary
station, it contains the address(es) of the secondary station(s). If it is sent by the
secondary station, it contains the address of the primary station. The address field may
be from 1 byte to several bytes.

107
 Control − It is 1 or 2 bytes containing flow and error control information.
 Payload − This carries the data from the network layer. Its length may vary from one
network to another.
 FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard
code used is CRC (cyclic redundancy code).

Types of HDLC Frames


There are three types of HDLC frames. The type of frame is determined by the control field of
the frame −
 I-frame − I-frames or Information frames carry user data from the network layer. They
also include flow and error control information that is piggybacked on user data. The
first bit of control field of I-frame is 0.

 S-frame − S-frames or Supervisory frames do not contain information field. They are
used for flow and error control when piggybacking is not required. The first two bits of
control field of S-frame is 10.

 U-frame − U-frames or Un-numbered frames are used for myriad miscellaneous


functions, like link management. It may contain an information field, if required. The
first two bits of control field of U-frame is 11.

Point to Point Protocol (PPP)


Point - to - Point Protocol (PPP) is a communication protocol of the data link layer that is used
to transmit multiprotocol data between two directly connected (point-to-point) computers. It is

108
a byte - oriented protocol that is widely used in broadband communications having heavy loads
and high speeds. Since it is a data link layer protocol, data is transmitted in frames. It is also
known as RFC 1661.
Services Provided by PPP
The main services provided by Point - to - Point Protocol are −
 Defining the frame format of the data to be transmitted.
 Defining the procedure of establishing link between two points and exchange of data.
 Stating the method of encapsulation of network layer data in the frame.
 Stating authentication rules of the communicating devices.
 Providing address for network communication.
 Providing connections over multiple links.
 Supporting a variety of network layer protocols by providing a range os services.
Components of PPP
Point - to - Point Protocol is a layered protocol having three components −
 Encapsulation Component − It encapsulates the datagram so that it can be transmitted
over the specified physical layer.
 Link Control Protocol (LCP) − It is responsible for establishing, configuring, testing,
maintaining and terminating links for transmission. It also imparts negotiation for set
up of options and use of features by the two endpoints of the links.
 Authentication Protocols (AP) − These protocols authenticate endpoints for use of
services. The two authentication protocols of PPP are −
• Password Authentication Protocol (PAP)
• Challenge Handshake Authentication Protocol (CHAP)
 Network Control Protocols (NCPs) − These protocols are used for negotiating the
parameters and facilities for the network layer. For every higher-layer protocol
supported by PPP, one NCP is there. Some of the NCPs of PPP are −
• Internet Protocol Control Protocol (IPCP)
• OSI Network Layer Control Protocol (OSINLCP)
• Internetwork Packet Exchange Control Protocol (IPXCP)
• DECnet Phase IV Control Protocol (DNCP)
• NetBIOS Frames Control Protocol (NBFCP)
• IPv6 Control Protocol (IPV6CP)

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

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

110
the flag byte or the escape byte. The receiver on receiving the message removes the escape byte
before passing it onto the network layer.

Channel Allocation Problem


Channel allocation is a process in which a single channel is divided and allotted to multiple
users in order to carry user specific tasks. There is user’s quantity may vary every time the
process takes place. If there are N number of users and channel is divided into N equal-sized
sub channels, each user is assigned one portion. If the number of users are small and don’t
vary at times, then Frequency Division Multiplexing can be used as it is a simple and efficient
channel bandwidth allocating technique.
Channel allocation problem can be solved by two schemes: Static Channel Allocation in
LANs and MANs, and Dynamic Channel Allocation.

1. Static Channel Allocation in LANs and MANs:


It is the classical or traditional approach of allocating a single channel among multiple
competing users Frequency Division Multiplexing (FDM). if there are N users, the
bandwidth is divided into N equal sized portions each user being assigned one portion.
since each user has a private frequency band, there is no interface between users.
It is not efficient to divide into fixed number of chunks.
T = 1/(U*C-L)

T(FDM) = N*T(1/U(C/N)-L/N)
Where,
T = mean time delay,
C = capacity of channel,
L = arrival rate of frames,
1/U = bits/frame,
N = number of sub channels,
T(FDM) = Frequency Division Multiplexing Time
2. Dynamic Channel Allocation:
Possible assumptions include:
1. Station Model:
Assumes that each of N stations independently produce frames. The probability of
producing a packet in the interval IDt where I is the constant arrival rate of new
frames.

111
2. Single Channel Assumption:
In this allocation all stations are equivalent and can send and receive on that
channel.
3. Collision Assumption:
If two frames overlap in time-wise, then that’s collision. Any collision is an error,
and both frames must have retransmitted. Collisions are only possible error.
4. Time can be divided into Slotted or Continuous.
5. Stations can sense a channel is busy before they try it.
Multiple Access

When a sender and receiver have a dedicated link to transmit data packets, the data link control
is enough to handle the channel. Suppose there is no dedicated path to communicate or transfer
the data between two devices. In that case, multiple stations access the channel and
simultaneously transmits the data over the channel. It may create collision and cross talk.
Hence, the multiple access protocol is required to reduce the collision and avoid crosstalk
between the channels.

For example, suppose that there is a classroom full of students. When a teacher asks a question,
all the students (small channels) in the class start answering the question at the same time
(transferring the data simultaneously). All the students respond at the same time due to which
data is overlap or data lost. Therefore, it is the responsibility of a teacher (multiple access
protocol) to manage the students and make them one answer.

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

1. Random Access Protocols

In this protocol, all the station has the equal priority to send the data over a channel. In random
access protocol, one or more stations cannot depend on another station nor any station control
another station. Depending on the channel's state (idle or busy), each station transmits the data
frame. However, if more than one station sends the data over a channel, there may be a collision

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

Following are the different methods of random-access protocols for broadcasting frames on
the channel.

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

ALOHA Random Access Protocol

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

Aloha Rules

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


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

Pure Aloha

Whenever data is available for sending over a channel at stations, we use Pure Aloha. In pure
Aloha, when each station transmits data to a channel without checking whether the channel is
idle or not, the chances of collision may occur, and the data frame can be lost. When any station
transmits the data frame to a channel, the pure Aloha waits for the receiver's acknowledgment.
If it does not acknowledge the receiver end within the specified time, the station waits for a
random amount of time, called the backoff time (Tb). And the station may assume the frame

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

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


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

Frames in pure ALOHA


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

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

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


2. The probability of successfully transmitting the data frame in the slotted Aloha is S =
G * e ^ - 2 G.
3. The total vulnerable time required in slotted Aloha is Tfr.

114
CSMA (Carrier Sense Multiple Access)

It is a carrier sense multiple access based on media access protocol to sense the traffic on a
channel (idle or busy) before transmitting the data. It means that if the channel is idle, the
station can send data to the channel. Otherwise, it must wait until the channel becomes idle.
Hence, it reduces the chances of a collision on a transmission medium.

CSMA Access Modes

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

Non-Persistent: It is the access mode of CSMA that defines before transmitting the data, each
node must sense the channel, and if the channel is inactive, it immediately sends the data.
Otherwise, the station must wait for a random time (not continuously), and when the channel
is found to be idle, it transmits the frames.

115
P-Persistent: It applies to slotted channels. It is the combination of 1-Persistent and Non-
persistent modes. The P-Persistent mode defines that each node senses the channel, and if the
channel is inactive, it sends a frame with a P probability. If the data is not transmitted, it waits
for a (q = 1-p probability) random time and resumes the frame with the next time slot.

O- Persistent: It is an O-persistent method that defines the superiority of the station before the
transmission of the frame on the shared channel. If it is found that the channel is inactive, each
station waits for its turn to retransmit the data.

CSMA/ CD

It is a carrier sense multiple access/ collision detection network protocol to transmit data
frames. The CSMA/CD protocol works with a medium access control layer. Therefore, it first
senses the shared channel before broadcasting the frames, and if the channel is idle, it transmits
a frame to check whether the transmission was successful. If the frame is successfully received,
the station sends another frame. If any collision is detected in the CSMA/CD, the station sends
a jam/ stop signal to the shared channel to terminate data transmission. After that, it waits for
a random time before sending a frame to a channel.

CSMA/ CA

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


transmission of data frames. It is a protocol that works with a medium access control layer.
When a data frame is sent to a channel, it receives an acknowledgment to check whether the
channel is clear. If the station receives only a single (own) acknowledgments, that means the
data frame has been successfully transmitted to the receiver. But if it gets two signals (its own
and one more in which the collision of frames), a collision of the frame occurs in the shared
channel. Detects the collision of the frame when a sender receives an acknowledgment signal.

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

Interframe space: In this method, the station waits for the channel to become idle, and if it
gets the channel is idle, it does not immediately send the data. Instead of this, it waits for some

116
time, and this time period is called the Interframe space or IFS. However, the IFS time is often
used to define the priority of the station.

Contention window: In the Contention window, the total time is divided into different slots.
When the station/ sender is ready to transmit the data frame, it chooses a random slot number
of slots as wait time. If the channel is still busy, it does not restart the entire process, except
that it restarts the timer only to send data packets when the channel is inactive.

Acknowledgment: In the acknowledgment method, the sender station sends the data frame to
the shared channel if the acknowledgment is not received ahead of time.

2. Controlled Access Protocols


It is a method of reducing data frame collision on a shared channel. In the controlled access
method, each station interacts and decides to send a data frame by a particular station approved
by all other stations. It means that a single station cannot send the data frames unless all other
stations are not approved. It has three types of controlled access: Reservation, Polling,
and Token Passing.
Reservation
 In the reservation method, a station needs to make a reservation before sending data.
 The time line has two kinds of periods:
1. Reservation interval of fixed time length
2. Data transmission period of variable frames.
 If there are M stations, the reservation interval is divided into M slots, and each
station has one slot.
 Suppose if station 1 has a frame to send, it transmits 1 bit during the slot 1. No other
station is allowed to transmit during this slot.
 In general, i th station may announce that it has a frame to send by inserting a 1 bit
into i th slot. After all N slots have been checked, each station knows which stations
wish to transmit.
 The stations which have reserved their slots transfer their frames in that order.
 After data transmission period, next reservation interval begins.
 Since everyone agrees on who goes next, there will never be any collisions.
The following figure shows a situation with five stations and a five slot reservation frame.
In the first interval, only stations 1, 3, and 4 have made reservations. In the second interval,
only station 1 has made a reservation.

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

118
Token Passing
 In token passing scheme, the stations are connected logically to each other in form of
ring and access of stations is governed by tokens.
 A token is a special bit pattern or a small message, which circulate from one station to
the next in the some predefined order.
 In Token ring, token is passed from one station to another adjacent station in the ring
whereas incase of Token bus, each station uses the bus to send the token to the next
station in some predefined order.
 In both cases, token represents permission to send. If a station has a frame queued for
transmission when it receives the token, it can send that frame before it passes the token
to the next station. If it has no queued frame, it passes the token simply.
 After sending a frame, each station must wait for all N stations (including itself) to send
the token to their neighbors and the other N – 1 stations to send a frame, if they have
one.
 There exist problems like duplication of token or token is lost or insertion of new
station, removal of a station, which need be tackled for correct and reliable operation of
this scheme.

3. Channelization Protocols

It is a channelization protocol that allows the total usable bandwidth in a shared channel to be
shared across multiple stations based on their time, distance and codes. It can access all the
stations at the same time to send the data frames to the channel.

Following are the various methods to access the channel based on their time, distance and
codes:

1. FDMA (Frequency Division Multiple Access)


2. TDMA (Time Division Multiple Access)
3. CDMA (Code Division Multiple Access)

119
FDMA

It is a frequency division multiple access (FDMA) method used to divide the available
bandwidth into equal bands so that multiple users can send data through a different frequency
to the subchannel. Each station is reserved with a particular band to prevent the crosstalk
between the channels and interferences of stations.

TDMA

Time Division Multiple Access (TDMA) is a channel access method. It allows the same
frequency bandwidth to be shared across multiple stations. And to avoid collisions in the shared
channel, it divides the channel into different frequency slots that allocate stations to transmit
the data frames. The same frequency bandwidth into the shared channel by dividing the signal
into various time slots to transmit it. However, TDMA has an overhead of synchronization that
specifies each station's time slot by adding synchronization bits to each slot.

CDMA

The code division multiple access (CDMA) is a channel access method. In CDMA, all stations
can simultaneously send the data over the same channel. It means that it allows each station to
transmit the data frames with full frequency on the shared channel at all times. It does not
require the division of bandwidth on a shared channel based on time slots. If multiple stations
send data to a channel simultaneously, their data frames are separated by a unique code
sequence. Each station has a different unique code for transmitting the data over a shared
channel. For example, there are multiple users in a room that are continuously speaking. Data

120
is received by the users if only two-person interact with each other using the same language.
Similarly, in the network, if different stations communicate with each other simultaneously
with different code language.

Ethernet Standards
The Ethernet standards come under the IEEE 802 section which deal with local area networks
and metropolitan area networks. In particular, IEEE 802.3 defines Ethernet. The different IEEE
802.3 standards define different aspects of Ethernet covering the physical layer and data link
layer's media access control (MAC) of wired Ethernet. Some of the individual standards may
introduce new versions or flavours of Ethernet to keep pace with the growing requirements for
speed and performance, whereas other standards may define aspects like the data frames used.
The different standards with their numbers are outlined in the table below:
Standard Ethernet Code
In order to understand standard Ethernet code, one must understand what each digit means.
Following is a guide:

Some of Ethernet version numbering:


• 10BASE5: 10 Mb/s over coaxial cable (ThickWire).
• 10BROAD36: 10 Mb/s over broadband cable, 3600 m max segments.
• 10BASE5: 1 Mb/s over 2 pairs of UTP.
• 10BASE2: 10 Mb/s over thin RG58 coaxial cable (ThinWire), 185 m max segments.
• 10BASE-T: 10 Mb/s over 2 pairs of UTP.
• 10BASE-FL: 10 Mb/s fiber optic point-to-point link.
• 10BASE-FB: 10 Mb/s fiber optic backbone (between repeaters). Also, known as
synchronous Ethernet.

121
Ethernet (IEEE 802.3) Frame Format –

 PREAMBLE – Ethernet frame starts with 7-Bytes Preamble. This is a pattern of


alternative 0’s and 1’s which indicates starting of the frame and allow sender and receiver
to establish bit synchronization. Initially, PRE (Preamble) was introduced to allow for the
loss of a few bits due to signal delays. But today’s high-speed Ethernet don’t need Preamble
to protect the frame bits. PRE (Preamble) indicates the receiver that frame is coming and
allow the receiver to lock onto the data stream before the actual frame begins.
 Start of frame delimiter (SFD) – This is a 1-Byte field which is always set to 10101011.
SFD indicates that upcoming bits are starting of the frame, which is the destination
address. Sometimes SFD is considered the part of PRE, this is the reason Preamble is
described as 8 Bytes in many places. The SFD warns station or stations that this is the
last chance for synchronization.
 Destination Address – This is 6-Byte field which contains the MAC address of machine
for which data is destined.
 Source Address – This is a 6-Byte field which contains the MAC address of source
machine. As Source Address is always an individual address (Unicast), the least
significant bit of first byte is always 0.
 Length – Length is a 2-Byte field, which indicates the length of entire Ethernet frame.
This 16-bit field can hold the length value between 0 to 65534, but length cannot be larger
than 1500 because of some own limitations of Ethernet.
 Data – This is the place where actual data is inserted, also known as Payload. Both IP
header and data will be inserted here if Internet Protocol is used over Ethernet. The
maximum data present may be as long as 1500 Bytes. In case data length is less than
minimum length i.e. 46 bytes, then padding 0’s is added to meet the minimum possible
length.
 Cyclic Redundancy Check (CRC) – CRC is 4 Byte field. This field contains a 32-bits
hash code of data, which is generated over the Destination Address, Source Address,
Length, and Data field. If the checksum computed by destination is not the same as sent
checksum value, data received is corrupted.
Fiber Distributed Data Interface (FDDI)
Fiber Distributed Data Interface (FDDI) is a set of ANSI and ISO standards for transmission
of data in local area network (LAN) over fiber optic cables. It is applicable in large LANs that
can extend up to 200 kilometers in diameter.

122
Features
 FDDI uses optical fiber as its physical medium.
 It operates in the physical and medium access control (MAC layer) of the Open Systems
Interconnection (OSI) network model.
 It provides high data rate of 100 Mbps and can support thousands of users.
 It is used in LANs up to 200 kilometers for long distance voice and multimedia
communication.
 It uses ring based token passing mechanism and is derived from IEEE 802.4 token bus
standard.
 It contains two token rings, a primary ring for data and token transmission and a
secondary ring that provides backup if the primary ring fails.
 FDDI technology can also be used as a backbone for a wide area network (WAN).

Figure: FDDI

123
Frame Format
The frame format of FDDI is similar to that of token bus as shown in the following diagram −

The fields of an FDDI frame are −


 Preamble: 1 byte for synchronization.
 Start Delimiter: 1 byte that marks the beginning of the frame.
 Frame Control: 1 byte that specifies whether this is a data frame or control frame.
 Destination Address: 2-6 bytes that specifies address of destination station.
 Source Address: 2-6 bytes that specifies address of source station.
 Payload: A variable length field that carries the data from the network layer.
 Checksum: 4 bytes frame check sequence for error detection.
 End Delimiter: 1 byte that marks the end of the frame.

IEEE 802.11x Standards


802.11x is generic term to refer to the IEEE 802.11 standard for defining communication over
a wireless LAN (WLAN). 802.11, commonly known as Wi-Fi, specifies an over-the-air
interface between a wireless client and a base station or between two wireless clients. These
standards are used to implement WLAN communication in 2.4, 3.6 and 5 GHz frequency
bands.
It is common to refer to 802.11 as the set of standards, but it is slightly more accurate to refer
to it as the 802.11 family or 802.11x as there is technically only one standard, which is
currently 802.11-2007. The rest of the "family" are technically amendments. Some of the
better known amendments are:

124
 802.11-1997: The original standard released in 1997 provided 1-2 Mbps transmission
speed in the 2.4 GHz band using Frequency Hoping Spread Spectrum (FHSS) or
Direct Sequence Spread Spectrum (DSSS). It is currently obsolete.
 802.11a: Provides a transmission speed of up to 54 Mbps in the 5 GHz band using
Orthogonal Frequency-Division Multiplexing (OFDM).
 802.11b: Works in the 2.4 GHz band and can provide up to 11 Mbps speed with a
fallback rate to 5.5, 2 and 1 Mbps. 802.11b only uses DSSS.
 802.11g: Provides a maximum speed of 54 Mbps in the 2.4 GHz band. 802.11g uses
OFDM and DSSS and is backwards compatible with 802.11b.
 802.11n: Provides up to 150 Mbps throughput using spatial multiplexing. It uses the
both 2.4 and 5 GHz band.

Bluetooth Standards

Bluetooth is a wireless technology standard used for exchanging data between devices over
short distances. Bluetooth uses short-wavelength ultra-high-frequency radio waves (at 2.4
GHz), invented by Ericsson in 1994 to achieve this. Though Bluetooth was standardized by the
IEEE, the responsibility of maintaining Bluetooth as a standard resides with the Bluetooth
Special Interest Group (SIG). In 2019, with close to 6 billion Bluetooth enabled units having
been shipped, Bluetooth is by far the most commonly found and used standard for short-
distance communication.

The networks that are formed by multiple devices connected by Bluetooth are divided into
two:

 Piconet
 Scatternet

Piconet

 A piconet is a network that consists of up to eight devices connected together.


 One of the devices is a master and the rest are all slaves.
 It covers only a smaller area.
 An example of piconets could be a mobile phone connected to a pair of wireless
headphones and a smartwatch. Here, the mobile phone is the master while the pair of
headphones and the smartwatch are slaves.

Scatternet

 A scatternet consists of two or more piconets.


 They are formed when one of the devices in a piconet (either the master or a slave)
decides to become a slave to the master of another piconet.
 It can cover a larger area when compared to piconets thanks to the larger number of
participants.
 Implementations of scatternets are scarce due to some technical limitations of
Bluetooth.

125
Why is Bluetooth used in modern devices and IOT?

 The main reason for this is that Bluetooth is quite easy to use, implement and is also
pretty cost-effective.
 The fact that it requires less energy to transmit data also adds up to the cost-effectiveness
and hence is an ideal choice for IoT projects that are expected to work on low-power.
 Another reason why Bluetooth is the go-to standard for short-range communication is the
speed of transmission, which can reach up to 2 Mbps easily. This makes it possible for
applications such as wireless displays streaming video files in high definition or HQ
audio being streamed to a wireless headset.

Advantages of Bluetooth

 The most important and obvious advantage of Bluetooth is that it is wireless.


 Implementing Bluetooth is a cheap process, and cuts down costs significantly.
 Bluetooth is automatic and generally doesn’t require one to push buttons or manually
create connections (when paired).
 Bluetooth is standardized and hence can be used across a wide range of devices.
 Other wireless devices rarely interfere with Bluetooth devices.
 As Bluetooth employs low power signals, it is an energy-efficient technology.
 Allows for the sharing of both data and voice simultaneously.
 Bluetooth is upgradable to new versions and newer versions are backward compatible
with the older ones.

Disadvantages of Bluetooth

 Data rates of Bluetooth generally is around 2 Mbps, while similar technologies can
offer data rates of up to 4 Mbps.
 The range of operation is generally only within 10 meters.

Token Bus
Token Bus (IEEE 802.4) is a standard for implementing token ring over virtual ring in LANs.
The physical media has a bus or a tree topology and uses coaxial cables. A virtual ring is created
with the nodes/stations and the token is passed from one node to the next in a sequence along
this virtual ring. Each node knows the address of its preceding station and its succeeding
station. A station can only transmit data when it has the token.
Token Passing Mechanism in Token Bus
A token is a small message that circulates among the stations of a computer network providing
permission to the stations for transmission. If a station has data to transmit when it receives a
token, it sends the data and then passes the token to the next station; otherwise, it simply passes
the token to the next station. This is depicted in the following diagram −

126
Token Ring
Token ring (IEEE 802.5) is a communication protocol in a local area network (LAN) where all
stations are connected in a ring topology and pass one or more tokens for channel acquisition.
A token is a special frame of 3 bytes that circulates along the ring of stations. A station can
send data frames only if it holds a token. The tokens are released on successful receipt of the
data frame.
Token Passing Mechanism in Token Ring
If a station has a frame to transmit when it receives a token, it sends the frame and then passes
the token to the next station; otherwise it simply passes the token to the next station. Passing
the token means receiving the token from the preceding station and transmitting to the
successor station. The data flow is unidirectional in the direction of the token passing. In order
that tokens are not circulated infinitely, they are removed from the network once their purpose
is completed. This is shown in the following diagram –

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

128
Features of Virtual LAN

 A VLAN forms sub-network grouping together devices on separate physical LANs.


 VLAN's help the network manager to segment LANs logically into different
broadcast domains.
 VLANs function at layer 2, i.e. Data Link Layer of the OSI model.
 There may be one or more network bridges or switches to form multiple, independent
VLANs.
 Using VLANs, network administrators can easily partition a single switched network
into multiple networks depending upon the functional and security requirements of
their systems.
 VLANs eliminate the requirement to run new cables or reconfiguring physical
connections in the present network infrastructure.
 VLANs help large organizations to re-partition devices aiming improved traffic
management.
 VLANs also provide better security management allowing partitioning of devices
according to their security criteria and also by ensuring a higher degree of control
connected devices.
 VLANs are more flexible than physical LANs since they are formed by logical
connections. This aids is quicker and cheaper reconfiguration of devices when the
logical partitioning needs to be changed.
Types of VLAN
129
 Protocol VLAN − Here, the traffic is handled based on the protocol used. A switch or
bridge segregates, forwards or discards frames the come to it based upon the traffics
protocol.
 Port-based VLAN − This is also called static VLAN. Here, the network
administrator assigns the ports on the switch / bridge to form a virtual network.
 Dynamic VLAN − Here, the network administrator simply defines network
membership according to device characteristics.

130
Unit-4
The Network Layer
The network Layer controls the operation of the subnet. The main aim of this layer is to deliver
packets from source to destination across multiple links (networks). If two computers (system)
are connected on the same link, then there is no need for a network layer. It routes the signal
through different channels to the other end and acts as a network controller. It also divides the
outgoing messages into packets and to assemble incoming packets into messages for higher
levels.

Functions of Network layer


 When data is to be sent, the network layer accepts data from the transport layer above,
divides and encapsulates it into packets and sends it to the data link layer. The reverse
procedure is done during receiving data.
 The network layer is responsible for routing packets from the source host to the destination
host. The routes can be based upon static tables that are rarely changed; or they can be
automatically updated depending upon network conditions.
 Many networks are partitioned into sub-networks or subnets. The network layer controls
the operations of the subnets. Network devices called routers operate in this layer to forward
packets between the subnets or the different networks.
 The lower layers assign the physical address locally. When the data packets are routed to
remote locations, a logical addressing scheme is required to differentiate the source system
and the destination system. This is provided by the network layer.
 This layer also provides mechanisms for congestion control, in situations when too many
packets overload the subnets.

131
 The network layer tackles issues like transmission delays, transmission time, avoidance of
jitters etc.
Virtual circuit networks
Virtual – circuit network is a category of packet switching network, where a virtual path is
established between the source and the destination systems for data communication to occur.
This path appears to the user as if it is a dedicated physical path, but actually is a logical circuit
allocated from a managed pool of circuit resources as per traffic requirements. The network
resources forming parts of this path can be shared by other communications, however, is not
visible to this user.

Features of Virtual – Circuit Network


 Virtual – circuit switching is done at the network layer of the communication system.
 In these networks, the path between the source and the destination nodes that is
followed by first data packet gets allocated. All other data packets transmitted between
them will use the same path.
 All the resources like buffers and bandwidth get reserved before the transmission, and
all data packets consume same resources.
 Since all packets follow the same path, a common header and routing information is
used by them.
 They provide greater reliability and less complexity owing to fixed paths and fixed
resources.

132
Phases of Virtual - Circuit Transmission
There are three phases of transmission by virtual circuits, set up, data transfer and teardown.
 Set up Phase − In this phase, a virtual circuit or a route is established from the source
to the destination through number of switches. The source and destination use global
addresses using which the switches make routing table entries.
 Data Transfer − Once the virtual circuit is set up, all packets follow the route
established during the set up phase adhering to the routing tables.
 Teardown Phase − When data transfer is complete, the source sends a teardown
request. The destination responds using a teardown confirmation. The switches flush
their routing table entries, thus relinquishing the circuit.
Advantages of virtual circuit
1. Packets are delivered to the receiver in the same order sent by the sender.
2. Virtual circuit is a reliable network circuit.
3. There is no need for overhead in each packet.
4. Single global packet overhead is used in virtual circuit.
Disadvantages of virtual circuit
1. Virtual circuit is costly to implement.
2. It provides only connection-oriented service.
3. Always a new connection set up is required for transmission.
Datagram Network
In a connectionless communication system, datagram refers to the smallest unit via which data
is transmitted. Datagrams are data packets which contain adequate header information so that
they can be individually routed by all intermediate network switching devices to the
destination. These networks are called datagram networks since communication occurs via
datagrams. They exist in packet switching networks.
Features of Datagram Networks
 Datagram switching is done at the network layer of the communication system.
 In datagram networks, each data packet or datagram is routed independently from the
source to the destination even if they belong to the same message. The network treats the
packet as if it exists alone.
 Since the datagrams are treated as independent units, no dedicated path is fixed for data
transfer. Each datagram is routed by the intermediate routers using dynamically changing
routing tables. So two successive packets from the source may follow completely separate
routes to reach destination.
 In these networks, no prior resource allocation is done for the individual packets. This
implies that no resources like buffers, processors, bandwidth, etc. are reserved before the
communication commences.
 In datagram networks, resources are allocated on demand on a First−Come First−Serve
(FCFS) basis. When a packet arrives at a router, the packet must wait if there are other
packets being processed, irrespective of its source or destination.

133
 Datagram communication is generally guided by User Datagram Protocol or UDP.
The following diagram shows datagram packets being send by host H1 to host H2. The four
datagram packets labelled as A, B, C and D, all belonging to same message are being routed
separately via separate routes. The packets in the message arrives in the destination out of order.
It is the responsibility of H2 to reorder the packets in order to retrieve the original message.

Advantages of Datagram Network

1. Datagrams can contain the full destination address rather than using some number.
2. There is no set up phase required for the datagram circuits. This means that no resources
are consumed.
3. If it happens during a transmission that one router goes down, the datagrams that will
suffer will include only those routers which would have been queued up in that specific
router. The other datagrams will not suffer.
4. If any fault or loss occurs on a communication line, the datagrams circuits are capable
of compensating for it.
5. Datagrams play an important role in the balancing of the traffic in the subnet. This is
so because halfway the router can be changed

Disadvantages of Datagram Network

1. Since the datagrams consist of the full destination address, they generate
more overhead and thus lead to wastage of the bandwidth. This in turn makes using
datagram approach quite costly.
2. A complicated procedure has to be followed for datagram circuits for determining the
destination of the packet.
3. In a subnet using the datagram approach, it is very difficult to keep congestion
problems at bay.

134
4. The any-to-any communication is one of the key disadvantages of the datagram
subnets. This means that if a system can communicate with any device, any of the
devices can communicate with this system. This can lead to various security issues.
5. Datagram subnets are prone to losing or re - sequencing the data packets during the
transition. This puts a great burden on the end systems for monitoring, recovering, and
reordering the packets as they were originally.
6. Datagram subnets have less capability of dealing with congestion control as well as
flow control. This happens because the direction of the incoming traffic is not
specified. In the virtual circuit subnets, the flow of the packets is directed only along
the virtual circuits thus making it comparatively easy for controlling it.
7. The unpredictable nature of the flow of the traffic makes it difficult to design the
datagram networks.

Difference between Virtual Circuits and Datagram Networks


Virtual Circuits Datagram Networks
1. Virtual Circuit is the connection 1. On other hand Datagram is the
oriented service in which there is a connection less service where no such
implementation of resources like resources are required for the data
buffers, CPU, bandwidth, etc., used by transmission.
virtual circuit for a data transfer session.
2. In Virtual circuits as all the resources 2. On other hand in case Datagram network,
and bandwidth get reserved before the the path is not fixed as data packets are
transmission, the path which is utilized free to decide the path on any
or followed by first data packet would intermediate router on the go by
get fixed and all other data packets will dynamically changing routing tables on
use the same path and consume same routers.
resources.
3. As there is same path followed by all the 3. On other hand different headers with
data packets, a common and same information of other data packet is being
header is being used by all the packets. used in Datagram network.

4. Virtual Circuit is less complex as 4. However on other hand Datagram


compared to that of Datagram network. network are more complex as compared
to Virtual circuit.

5. Due to fixed path and assurance of fixed 5. On other hand Datagram network due to
resources, Virtual Circuits are more dynamic resource allocation and follow
reliable for data transmission as dynamic path is more prone to error and
compared to Datagram network. is less reliable than Virtual circuits.

6. Virtual circuits are costlier in 6. On the other hand Datagram network are
installation and maintenance and are cheaper as compared to the Virtual
widely used by ATM (Asynchronous Circuits and are mainly used by IP
Transfer Mode) Network, which is used network, which is used for Data services
for the Telephone calls. like Internet.

135
Ipv4 addresses
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a
device (for example, a computer or a router) to the Internet. IPv4 addresses are unique. They
are unique in the sense that each address defines one, and only one, connection to the Internet.
Two devices on the Internet can never have the same address at the same time.
Address space
A protocol such as IPv4 that defines addresses has an address space. An address space is the
total number of addresses used by the protocol. If a protocol uses N bits to define an address,
the address space is 2N because each bit can have two different values (0 or 1) and N bits can
have 2N values.
IPv4 uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296 (more
than 4 billion). This means that, theoretically, if there were no restrictions, more than 4 billion
devices could be connected to the Internet. We will see shortly that the actual number is much
less because of the restrictions imposed on the addresses.
Notations
There are two prevalent notations to show an IPv4 address: binary notation and dotted-decimal
notation.
Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often referred to as a
byte. So it is common to hear an IPv4 address referred to as a 32-bit address or a 4-byte address.
The following is an example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010
Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read, Internet addresses are usually
written in decimal form with a decimal point (dot) separating the bytes.
The following is the dotted-decimal notation of the above address:
[Link]
Internet Protocol hierarchy contains several classes of IP Addresses to be used efficiently in
various situations as per the requirement of hosts per network. Broadly, the IPv4 Addressing
system is divided into five classes of IP Addresses. All the five classes are identified by the
first octet of IP Address.
Internet Corporation for Assigned Names and Numbers is responsible for assigning IP
addresses.
The first octet referred here is the left most of all. The octets numbered as follows depicting
dotted decimal notation of IP Address:

136
The number of networks and the number of hosts per class can be derived by this formula:

Classful Addressing
IPv4 addressing, at its inception, used the concept of classes. This architecture is called classful
addressing.
In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Each
class occupies some part of the address space.
We can find the class of an address when given the address in binary notation or dotted-decimal
notation. If the address is given in binary notation, the first few bits can immediately tell us the
class of the address. If the address is given in decimal-dotted notation, the first byte defines the
class.
Subnet Mask:
Subnet Mask is used in networking to create multiple sub networks in a network. It divides
the IP address into multiple parts which can be assigned to every computer. Subnet Mask is
also 32 bits long. If the IP address in binary is ANDed with its Subnet Mask, the result yields
the Network address. For example, say the IP Address is [Link] and the Subnet Mask
is [Link] then
:

Class A Address:
The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from 1 – 127,
i.e.

137
Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range
127.x.x.x is reserved for loopback IP addresses. The default subnet mask for Class A IP address
is [Link] which implies that Class A addressing can have 126 networks (27-2) and 16777214
hosts (224-2).
Class A IP address format is thus: [Link]
Class B Address:
An IP address which belongs to class B has the first two bits in the first octet set to 10, i.e.

Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default subnet mask for Class
B is 255.255.x.x. Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses.
Class B IP address format is: [Link]
Class C Address:
The first octet of Class C IP address has its first 3 bits set to 110, that is:

Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default subnet mask for Class
C is 255.255.255.x. Class C gives 2097152 (221) Network addresses and 254 (28-2) Host
addresses.
Class C IP address format is: [Link]
Class D Address:
Very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of:

Class D has IP address rage from [Link] to [Link]. Class D is reserved for
Multicasting. In multicasting data is not destined for a particular host, that is why there is no
need to extract host address from the IP address, and Class D does not have any subnet mask.
Class E Address:
This IP Class is reserved for experimental purposes only for R&D or Study. IP addresses in
this class ranges from [Link] to [Link]. Like Class D, this class too is not equipped
with any subnet mask.

Classes and Blocks


One problem with classful addressing is that each class is divided into a fixed number of blocks
with each block having a fixed size.

138
Netid and Hostid
In classful addressing, an IP address in class A, B, or C is divided into netid and hostid. These
parts are of varying lengths, depending on the class of the address. In class A, one byte defines
the netid and three bytes define the hostid. In class B, two bytes define the netid and two bytes
define the hostid. In class C, three bytes define the netid and one byte defines the hostid.

Subnetting
During the era of classful addressing, subnetting was introduced. If an organization was granted
a large block in class A or B, it could divide the addresses into several contiguous groups and
assign each group to smaller networks (called subnets) or, in rare cases, share part of the
addresses with neighbors. Subnetting increases the number of 1’s in the mask, as we will see
later when we discuss classless addressing.
Supernetting
Supernetting is the process of summarizing a bunch of contiguous Subnetted networks back in
a single large network. Supernetting is also known as route summarization and route
aggregation. Supernetting is mainly done for optimizing the routing tables. A routing table is
the summary of all known networks. Routers share routing tables to find the new path and
locate the best path for destination.

Without Supernetting, router will share all routes from routing tables as they are. With
Supernetting, it will summarize them before sharing. Route summarization reduces the size of
routing updates dramatically.

The time came when most of the class A and class B addresses were depleted; however, there
was still a huge demand for midsize blocks. The size of a class C block with a maximum
number of 256 addresses did not satisfy the needs of most organizations. Even a midsize
organization needed more addresses. One solution was supernetting. In supernetting, an
organization can combine several class C blocks to create a larger range of addresses. In other

139
words, several networks are combined to create a supernetwork or a supemet. An organization
can apply for a set of class C blocks instead of just one. For example, an organization that needs
1000 addresses can be granted four contiguous class C blocks. The organization can then use
these addresses to create one supernetwork. Supernetting decreases the number of Is in the
mask. For example, if an organization is given four class C addresses, the mask changes from
/24 to /22. We will see that classless addressing eliminated the need for supernetting.
Classless addressing
Classless addressing is a concept of addressing the IPv4 addresses. It was adopted after the
failure of classful addressing. The classful addressing leads to wastage of addresses as it assigns
a fixed-size block of addresses to the customer. But, the classless addressing assigns a block of
addresses to the customer according to its requirement which prevents the wastage of
addresses.
Rules
1. Address should be contiguous.
2. No of addresses in a block must be in power of 2.
3. The first address of every block must be divisible by the length of the block

Exercise 1. Calculate the number of sub-network and total no of host in a sub-network for IP
address [Link]/25. Also calculate the valid Subnet mask, Network address, Broadcast
address, usable host range in each sub-network.
Solution:
IP address: [Link]/25
Subnet mask: 11111111. 11111111. 11111111. 10000000
255. 255. 255. 128
Total subnets/Total no. of networks
2 (total no. of bits borrowed from host)
= 21
=2
Total hosts/Number of IP address on each network
2 (total no. of host bits)
= 27
=128
Usable hosts
2 (total no. of host bits) -2
=128-2

140
=126
Valid subnets (4th octet)
=256-128
=128
Subnet (Network ID) Valid host ID Range Broadcast Address
[Link] [Link]– [Link] [Link]
[Link] [Link] – [Link] [Link]

a. Is this a host, network or broadcast address?


It is a network address.
b. What is the subnet mask in dotted decimal?
[Link]
c. What is the network address?
[Link]/25
d. What is the broadcast address?
[Link]/25
e. What is the first usable host address?
[Link]/25
f. What is the last usable host address?
[Link]/25
g. How many usable hosts are in the networks?
126
h. What is the next available network address?
[Link]/25

Exercise 2. Calculate the number of sub-network and total no of host in a sub-network for IP
address [Link]/26. Also calculate the valid Subnet mask, Network address, Broadcast
address, usable host range in each sub-network.
Solution:
IP address: [Link]/26
Subnet mask: 11111111. 11111111. 11111111. 11000000
255. 255. 255. 192
Total subnets/Total no. of networks
2 (total no. of bits borrowed from host)
= 22
=4
Total hosts/Number of IP address on each network
2 (total no. of host bits)

141
= 26
=64
Usable hosts
2 (total no. of host bits) -2
=64-2
=62
Valid subnets (4th octet)
=256-192
=64
Subnet Valid host ID Range Broadcast Address
(Network ID)
[Link] [Link] – [Link] [Link]
[Link] [Link]– [Link] [Link]
[Link] [Link]– [Link] [Link]
[Link] [Link]– [Link] [Link]

a. Is this a host, network or broadcast address?


It is a host address.
b. What is the subnet mask in dotted decimal?
[Link]
c. What is the network address?
[Link]/26
d. What is the broadcast address?
[Link]/26
e. What is the first usable host address?
[Link]/26
f. What is the last usable host address?
[Link]/26
g. How many usable hosts are in the networks?
62
h. What is the next available network address?
[Link]/26

Exercise 3. Calculate the number of sub-network and total no of host in a sub-network for IP
address [Link]/17. Also calculate the valid Subnet mask, Network address, Broadcast
address, usable host range in each sub-network.
Solution:
IP address: [Link]/17
142
Subnet mask: 11111111. 11111111. 10000000. 00000000
255. 255. 128. 0
Total subnets/Total no. of networks
2 (total no. of bits borrowed from host)
= 21
=2
Total hosts/Number of IP address on each network
2 (total no. of host bits)
= 215
=32768
Usable hosts
2 (total no. of host bits) -2
=32768-2
=32766
Valid subnets (3rd octet)
=256-128
=128
Valid subnets (4th octet)
=256-0
=256
Subnet (Network ID) Valid host ID Range Broadcast Address
[Link] [Link] - [Link] [Link]
[Link] [Link] - [Link] [Link]

a. Is this a host, network or broadcast address?


It is a network address.
b. What is the subnet mask in dotted decimal?
[Link]
c. What is the network address?
[Link]/17
d. What is the broadcast address?
[Link]/17
e. What is the first usable host address?
[Link]/17
f. What is the last usable host address?

143
[Link]/17
g. How many usable hosts are in the networks?
32766
h. What is the next available network address?
[Link]/17

Exercise 4. Calculate the number of sub-network and total no of host in a sub-network for IP
address [Link]/9. Also calculate the valid Subnet mask, Network address, Broadcast address,
usable host range in each sub-network.
Solution:
IP address: [Link]/9
Subnet mask: 11111111. 10000000. 00000000. 00000000
255. 128. 0. 0
Total subnets/Total no. of networks
2 (total no. of bits borrowed from host)
= 21
=2
Total hosts/Number of IP address on each network
2 (total no. of host bits)
= 223
=8388608
Usable hosts
2 (total no. of host bits) -2
=8388608-2
=8388606
Valid subnets (2nd octet)
=256-128
=128
Valid subnets (3rd octet)
=256-0
=256
Valid subnets (4th octet)

144
=256-0
=256
Subnet (Network ID) Valid host ID Range Broadcast Address
[Link] [Link] – [Link] [Link]
[Link] [Link] – [Link] [Link]

a. Is this a host, network or broadcast address?


It is a host address.
b. What is the subnet mask in dotted decimal?
[Link]
c. What is the network address?
[Link]/9
d. What is the broadcast address?
[Link]/9
e. What is the first usable host address?
[Link]/9
f. What is the last usable host address?
[Link]/9
g. How many usable hosts are in the networks?
8388606
h. What is the next available network address?
[Link]/9

Network Address Translation (NAT)


Network Address Translation (NAT) is a process in which one or more local IP address is
translated into one or more Global IP address and vice versa in order to provide Internet
access to the local hosts. Also, it does the translation of port numbers i.e. masks the port
number of the host with another port number, in the packet that will be routed to the
destination. It then makes the corresponding entries of IP address and port number in the
NAT table. NAT generally operates on router or firewall.
Network Address Translation (NAT) working –
Generally, the border router is configured for NAT i.e the router which has one interface in
local (inside) network and one interface in the global (outside) network. When a packet
traverse outside the local (inside) network, then NAT converts that local (private) IP address
to a global (public) IP address. When a packet enters the local network, the global (public)
IP address is converted to a local (private) IP address.
If NAT run out of addresses, i.e., no address is left in the pool configured then the packets
will be dropped and an Internet Control Message Protocol (ICMP) host unreachable packet
to the destination is sent.

NAT inside and outside addresses –

145
Inside refers to the addresses which must be translated. Outside refers to the addresses which
are not in control of an organisation. These are the network Addresses in which the translation
of the addresses will be done.

 Inside local address – An IP address that is assigned to a host on the Inside (local)
network. The address is probably not a IP address assigned by the service provider i.e.,
these are private IP address. This is the inside host seen from the inside network.
 Inside global address – IP address that represents one or more inside local IP addresses
to the outside world. This is the inside host as seen from the outside network.
 Outside local address – This is the actual IP address of the destination host in the local
network after translation.
 Outside global address – This is the outside host as seen form the outside network. It is
the IP address of the outside destination host before translation.

Network Address Translation (NAT) Types –


There are 3 ways to configure NAT:
1. Static NAT – In this, a single unregistered (Private) IP address is mapped with a legally
registered (Public) IP address i.e one-to-one mapping between local and global address.
This is generally used for Web hosting. These are not used in organisations as there are
many devices who will need Internet access and to provide Internet access, the public IP
address is needed.
Suppose, if there are 3000 devices who need access to the Internet, the organisation have
to buy 3000 public addresses that will be very costly.
2. Dynamic NAT – In this type of NAT, an unregistered IP address is translated into a
registered (Public) IP address from a pool of public IP address. If the IP address of pool
is not free, then the packet will be dropped as an only a fixed number of private IP address
can be translated to public addresses.
Suppose, if there is a pool of 2 public IP addresses then only 2 private IP addresses can
be translated at a given time. If 3rd private IP address wants to access Internet then the
packet will be dropped therefore many private IP addresses are mapped to a pool of public
IP addresses. NAT is used when the number of users who wants to access the Internet is
fixed. This is also very costly as the organisation have to buy many global IP addresses
to make a pool.
3. Port Address Translation (PAT) – This is also known as NAT overload. In this, many
local (private) IP addresses can be translated to a single registered IP address. Port
numbers are used to distinguish the traffic i.e., which traffic belongs to which IP address.
This is most frequently used as it is cost-effective as thousands of users can be connected
to the Internet by using only one real global (public) IP address.

Advantages of NAT –

146
 NAT conserves legally registered IP addresses .
 It provides privacy as the device IP address, sending and receiving the traffic, will be
hidden.
 Eliminates address renumbering when a network evolves.
Disadvantage of NAT –
 Translation results in switching path delays.
 Certain applications will not function while NAT is enabled.
 Complicates tunnelling protocols such as IPsec.
 Also, router being a network layer device, should not tamper with port numbers
(transport layer) but it has to do so because of NAT.

IPV4 Datagram format


Packets in the network (internet) layer are called datagrams. A datagram is a variable-length
packet consisting of two parts: header and data. The header is 20 to 60 bytes in length and
contains information essential to routing and delivery. It is customary in TCP/IP to show the
header in 4-byte sections.

The encapsulated data is referred to as IP Payload. IP header contains all the necessary
information to deliver the packet at the other end.

IP header includes many relevant information including Version Number, which, in this
context, is 4. Other details are as follows:
 Version: Version no. of Internet Protocol used (e.g. IPv4).

147
 IHL: Internet Header Length; Length of entire IP header.
 DSCP: Differentiated Services Code Point; this is Type of Service.
 ECN: Explicit Congestion Notification; It carries information about the congestion seen
in the route.
 Total Length: Length of entire IP Packet (including IP header and IP Payload).
 Identification: If IP packet is fragmented during the transmission, all the fragments
contain same identification number. To identify original IP packet they belong to.
 Flags: As required by the network resources, if IP Packet is too large to handle, these
‘flags’ tells if they can be fragmented or not. In this 3-bit flag, the MSB is always set
to ‘0’. The second bit called the do not fragment bit. If its value is 1, the machine must
not fragment the datagram. If it cannot pass the datagram through any available physical
network, it discards the datagram and sends an ICMP error message to the source host.
It its value is 0, the datagram can be fragmented if necessary. The third bit is called the
more fragment bit, if its value is 1, it means the datagram is not the last fragment. It its
value is 0, it means this is the last or only fragment.
 Fragment Offset: This offset tells the exact position of the fragment in the original IP
Packet.
 Time to Live: To avoid looping in the network, every packet is sent with some TTL
value set, which tells the network how many routers (hops) this packet can cross. At
each hop, its value is decremented by one and when the value reaches zero, the packet
is discarded.
 Protocol: Tells the Network layer at the destination host, to which Protocol this packet
belongs to, i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP
is 6 and UDP is 17.
 Header Checksum: This field is used to keep checksum value of entire header which
is then used to check if the packet is received error-free.
 Source Address: 32-bit address of the Sender (or source) of the packet.
 Destination Address: 32-bit address of the Receiver (or destination) of the packet.
 Options: This is optional field, which is used if the value of IHL is greater than 5.
These options may contain values for options such as Security, Record Route, Time
Stamp, etc.

Fragmentation
Fragmentation is a technique implemented on a datagram at the network layer if the size of the
datagram is larger than the size of the datagram that the corresponding network can forward.
This technique involves the division of the large size datagram into smaller fragments.
Need for fragmentation

The datagram created by the network layer at the source computer has to pass through several
networks before it reaches the destination computer. Usually, the source computer prefers to
send the datagrams of large size.

148
This is because if the datagram is split into small fragments, then for each fragmented
datagram unit the header is repeated. This repetition of the header for each fragmented
datagram wastes the network bandwidth.

 It is done by network layer at the destination side and is usually done at routers.
 Source side does not require fragmentation due to wise (good) segmentation by
transport layer i.e. instead of doing segmentation at transport layer and fragmentation at
network layer, the transport layer looks at datagram data limit and frame data limit and
does segmentation in such a way that resulting data can easily fit in a frame without the
need of fragmentation.
 Receiver identifies the frame with the identification (16 bits) field in IP header. Each
fragment of a frame has same identification number.
 Receiver identifies sequence of frames using the fragment offset(13 bits) field in IP
header
 An overhead at network layer is present due to extra header introduced due to
fragmentation.

An example of IPv4 multiple fragmentation. The fragmentation takes place on two levels. In the first one, The
maximum transmission unit is 4000 bytes, and the second it is 2500 bytes.

149
IPV6 Addressing and its features
IPv6 Header:
The wonder of IPv6 lies in its header. An IPv6 address is 4 times larger than IPv4, but
surprisingly, the header of an IPv6 address is only 2 times larger than that of IPv4. IPv6 headers
have one Fixed Header and zero or more Optional (Extension) Headers. All the necessary
information that is essential for a router is kept in the Fixed Header. The Extension Header
contains optional information that helps routers to understand how to handle a packet/flow.

IPv6 fixed header is 40 bytes long and contains the following information.
S.N. Field & Description

1 Version (4-bits): It represents the version of Internet Protocol, i.e. 0110.

2 Traffic Class (8-bits): These 8 bits are divided into two parts. The most significant 6 bits are
used for Type of Service to let the Router Known what services should be provided to this
packet. The least significant 2 bits are used for Explicit Congestion Notification (ECN).

3 Flow Label (20-bits): This label is used to maintain the sequential flow of the packets
belonging to a communication. The source labels the sequence to help the router identify that
a particular packet belongs to a specific flow of information. This field helps avoid re-ordering
of data packets. It is designed for streaming/real-time media.
4 Payload Length (16-bits): This field is used to tell the routers how much information a
particular packet contains in its payload. Payload is composed of Extension Headers and
Upper Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the Extension
Headers contain Hop-by-Hop Extension Header, then the payload may exceed 65535 bytes
and this field is set to 0.

150
5 Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if
the Extension Header is not present then it indicates the Upper Layer PDU. The values for the
type of Upper Layer PDU are same as IPv4’s.
6 Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is
same as TTL in IPv4. The value of Hop Limit field is decremented by 1 as it passes a link
(router/hop). When the field reaches 0 the packet is discarded.
7 Source Address (128-bits): This field indicates the address of originator of the packet.

8 Destination Address (128-bits): This field provides the address of intended recipient of the
packet.

Features:
The successor of IPv4 is not designed to be backward compatible. Trying to keep the basic
functionalities of IP addressing, IPv6 is redesigned entirely. It offers the following features:
 Larger Address Space:

In contrast to IPv4, IPv6 uses 4 times more bits to address a device on the Internet. This much
of extra bits can provide approximately 3.4×1038 different combinations of addresses. This
address can accumulate the aggressive requirement of address allotment for almost everything
in this world. According to an estimate, 1564 addresses can be allocated to every square meter
of this earth.
 Simplified Header:

IPv6’s header has been simplified by moving all unnecessary information and options (which
are present in IPv4 header) to the end of the IPv6 header. IPv6 header is only twice as bigger
than IPv4 providing the fact the IPv6 address is four times longer.
 End-to-end Connectivity:

Every system now has unique IP address and can traverse through the internet without using
NAT or other translating components. After IPv6 is fully implemented, every host can directly
reach other host on the Internet, with some limitations involved like Firewall, Organization’s
policies, etc.
 Auto-configuration:

IPv6 supports both stateful and stateless auto configuration mode of its host devices. This way
absence of a DHCP server does not put halt on inter segment communication.
 Faster Forwarding/Routing:

Simplified header puts all unnecessary information at the end of the header. All information in
first part of the header are adequate for a Router to take routing decision thus making routing
decision as quickly as looking at the mandatory header.

 IPSec:

151
Initially it was decided for IPv6 to must have IPSec security, making it more secure than IPv4.
This feature has now been made optional.
 No Broadcast:

Though Ethernet/Token Ring are considered as broadcast network because they support
Broadcasting, IPv6 does not have any Broadcast support anymore left with it. It uses multicast
to communicate with multiple hosts.
 Anycast Support:

This is another characteristic of IPv6. IPv6 has introduced Anycast mode of packet routing. In
this mode, multiple interfaces over the Internet are assigned same Anycast IP address. Routers,
while routing, sends the packet to the nearest destination.
 Mobility:

IPv6 was designed keeping mobility feature in mind. This feature enables hosts (such as mobile
phone) to roam around in different geographical area and remain connected with same IP
address. IPv6 mobility feature takes advantage of auto IP configuration and Extension headers.
 Enhanced Priority support:

Where IPv4 used 6 bits DSCP (Differential Service Code Point) and 2 bits ECN (Explicit
Congestion Notification) to provide Quality of Service but it could only be used if the end-to-
end devices support it, that is, the source and destination device and underlying network must
support it.
In IPv6, Traffic class and Flow label are used to tell underlying routers how to efficiently
process the packet and route it.
 Smooth Transition:

Large IP address scheme in IPv6 enables to allocate devices with globally unique IP addresses.
This assures that mechanism to save IP addresses such as NAT is not required. So devices can
send/receive data between each other, for example VoIP and/or any streaming media can be
used much efficiently.
Other fact is, the header is less loaded so routers can make forwarding decision and forward
them as quickly as they arrive.
 Extensibility:

One of the major advantage of IPv6 header is that it is extensible to add more information in
the option part. IPv4 provides only 40-bytes for options whereas options in IPv6 can be as
much as the size of IPv6 packet itself.
Addressing Modes:

In computer networking, addressing mode refers to the mechanism how we address a host on
the network. IPv6 offers several types of modes by which a single host can be addressed, more
than one host can be addressed at once or the host at closest distance can be addressed.

152
1. Unicast:
The one-to-one communication mode between hosts. Switches and routers on the network only
forward data but do not duplicate data. If 10 clients need the same data, the server needs to
send it one by one, repeating the same work 10 times. However, it can respond to each customer
in a timely manner. Therefore, web browsing uses the unicast mode, that is, the IP unicast
protocol. Routers and switches in the network select transmission paths based on their
destination addresses and send IP unicast data to their designated destinations.

Advantages of unicast:
1. The server responds to the client’s request in a timely manner.
2. The server sends different data to each customer’s requests, which facilitates
personalized services.

Disadvantages of unicast:
1. The server sends data streams to each client. Server traffic = Number of clients *
Client traffic; Servers are overburdened in streaming media applications with a large
number of clients and a large amount of traffic per client.
2. The existing network bandwidth is a pyramid structure, the inter-city, and inter-
provincial backbone bandwidth is only 5% of the total bandwidth of all users. If only
unicast protocols are used, the backbone network will be overloaded. The current P2P
application has often blocked the backbone. Expanding the backbone by 20 times is
almost impossible.

2. Broadcast

The one-to-all communication mode between hosts. Switches on the network unconditionally
copy and forward signals from each host, all hosts can receive all the information (whether you
want it) and because they do not have path selection, their network costs can below. Cable TV
networks are typical broadcast networks. Our TVs receive signals from all channels, but only
one channel is restored to the picture. Broadcasting is allowed on the data network but is
restricted to the LAN of the Layer 2 switch. Broadcast data is prohibited from passing through
the router to prevent broadcast data from affecting a large number of hosts.

153
Advantages of broadcast:
1. Simple network devices, easy maintenance, and low network deployment costs.
2. Server traffic load is extremely low because the server does not have to send data to
each client individually.

Disadvantages of broadcast:
1. Unable to provide personalized service in a timely manner to each customer’s
requirements and timing.
2. The bandwidth allowed by the server to provide data is limited. The maximum
bandwidth of the client is equal to the total bandwidth of the service. For example,
cable TV clients support 100 channels on their lines (or 500 channels in theory if
digital compression is used) Even if the service provider has more money to deploy
more transmitters and switch to a fiber-optic backbone, this limit cannot be exceeded.
This means that it is impossible to provide more diversified and personalized services
to many customers.
3. Broadcasts are prohibited from being transmitted over the Internet broadband
network.

3. Multicast:

The one-to-one group communication mode between hosts. That is, hosts in the same group
can receive all data in the group. A host can request a router to join or leave a group. The routers
and switches on the network selectively copy and transmit data, that is, transmit data only to
the hosts that join the group. In this way, data can be transmitted to multiple hosts in a group
at a time, and another communication of other hosts that are not in a group is not affected.

154
Advantages of multicast:
1. Clients which need the same data flow join the same group to share one data flow,
reducing server load. Multicast has the advantages of the broadcast.
2. The multicast protocol replicates and forwards data flows based on the requirements
of the receiver. Therefore, the total service bandwidth of the server is not limited by
the bandwidth of the client. The IP protocol allows more than 260 million multicast
services. Therefore, the IP protocol can provide abundant services.
3. Multicast protocols, like unicast protocols, allow transmission over Internet
broadband networks.

Disadvantages of multicast:
1. Compared with the unicast protocol, the multicast protocol does not have an error
correction mechanism. The packet loss and error cannot be rectified, but the fault
tolerance mechanism and QoS can be used to rectify the fault.
2. Although the existing network supports multicast transmission, customer
authentication and QoS need to be improved. Theoretically, there are mature solutions
to these disadvantages. However, these disadvantages need to be gradually applied to
existing networks.

Address Structure:
An IPv6 address is made of 128 bits divided into eight 16-bits blocks. Each block is then
converted into 4-digit Hexadecimal numbers separated by colon symbol.
For example, the below is 128 bit IPv6 address represented in binary format and divided into
eight 16-bits blocks:
0010000000000001 0000000000000000 0011001000110100 1101111111100001
0000000001100011 0000000000000000 0000000000000000 1111111011111011
Each block is then converted into Hexadecimal and separated by ‘:’ symbol:
2001:0000:3234:DFE1:0063:0000:0000:FEFB
Even after converting into Hexadecimal format, IPv6 address remains long. IPv6 provides
some rules to shorten the address. These rules are:
Rule: 1 Discard leading Zero (es):
In Block 5, 0063, the leading two 0s can be omitted, such as (5th block):
2001:0000:3234:DFE1:63:0000:0000:FEFB
Rule: 2 If two of more blocks contains consecutive zeroes, omit them all and replace with
double colon sign ::, such as (6th and 7th block):
2001:0000:3234:DFE1:63::FEFB
Consecutive blocks of zeroes can be replaced only once by :: so if there are still blocks of
zeroes in the address they can be shrink down to single zero, such as (2nd block):
2001:0:3234:DFE1:63::FEFB

155
Difference between IPv4 and IPv6:
IPv4 IPv6
1. IPv6 addresses are 128 bit length.
1. IPv4 addresses are 32 bit length.
2. IPv4 addresses are binary numbers represented in 2. IPv6 addresses are binary numbers
represented in hexadecimals.
decimals.
3. Inbuilt IPSec support.
3. IPSec support is only optional.
4. Fragmentation is done by sender and forwarding 4. Fragmentation is done only by sender.
routers.
5. Packet flow identification is available
5. No packet flow identification.
within the IPv6 header using the Flow
Label field.
6. No checksum field in IPv6 header.
6. Checksum field is available in IPv4 header
7. No option fields, but IPv6 Extension
7. Options fields are available in IPv4 header.
headers are available.
8. Address Resolution Protocol (ARP) is available to 8. Address Resolution Protocol (ARP) is
replaced with a function of Neighbor
map IPv4 addresses to MAC addresses.
Discovery Protocol (NDP).
9. Internet Group Management Protocol (IGMP) is 9. IGMP is replaced with Multicast Listener
Discovery (MLD) messages.
used to manage multicast group membership.
10. Broadcast messages are not available.
10. Broadcast messages are available.
Instead a link-local scope "All nodes"
multicast IPv6 address (FF02::1) is used
for broadcast similar functionality.
11. Manual configuration (Static) of IPv4 addresses 11. Auto-configuration of addresses is
available.
or DHCP (Dynamic configuration) is required
configure IPv4 addresses.

Routing

A Router is a process of selecting path along which the data can be transferred from source to
the destination. Routing is performed by a special device known as a router. A Router works
at the network layer in the OSI model and internet layer in TCP/IP model. A router is a
networking device that forwards the packet based on the information available in the packet
header and forwarding table. The routing algorithms are used for routing the packets. The
routing algorithm is nothing but a software responsible for deciding the optimal path through
which packet can be transmitted. The routing protocols use the metric to determine the best
path for the packet delivery. The metric is the standard of measurement such as hop count,
bandwidth, delay, current load on the path, etc. used by the routing algorithm to determine the

156
optimal path to the destination. The routing algorithm initializes and maintains the routing table
for the process of path determination.

Types of Routing

Routing can be classified into three categories:

o Static Routing
o Default Routing
o Dynamic Routing

Static Routing
o Static Routing is also known as Nonadoptive Routing.
o It is a technique in which the administrator manually adds the routes in a routing table.
o A Router can send the packets for the destination along the route defined by the
administrator.
o In this technique, routing decisions are not made based on the condition or topology of
the networks

Advantages
o No Overhead: It has no overhead on the CPU usage of the router. Therefore, the
cheaper router can be used to obtain static routing.
o Bandwidth: It has not bandwidth usage between the routers.
o Security: It provides security as the system administrator is allowed only to have
control over the routing to a particular network.

Disadvantages
o For a large network, it becomes a very difficult task to add each route manually to the
routing table.
o The system administrator should have a good knowledge of a topology as he has to add
each route manually

Default Routing

o Default Routing is a technique in which a router is configured to send all the packets to
the same hop device, and it doesn't matter whether it belongs to a particular network or
not. A Packet is transmitted to the device for which it is configured in default routing.
o Default Routing is used when networks deal with the single exit point.

157
o It is also useful when the bulk of transmission networks have to transmit the data to the
same hop device.
o When a specific route is mentioned in the routing table, the router will choose the
specific route rather than the default route. The default route is chosen only when a
specific route is not mentioned in the routing table.

Dynamic Routing

o It is also known as Adaptive Routing.


o It is a technique in which a router adds a new route in the routing table for each packet
in response to the changes in the condition or topology of the network.
o Dynamic protocols are used to discover the new routes to reach the destination.
o In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
o If any route goes down, then the automatic adjustment will be made to reach the
destination.

Distance vector routing


Distance vector routing is an asynchronous algorithm in which node x sends the copy of its
distance vector to all its neighbours. When node x receives the new distance vector from one
of its neighbouring vector, v, it saves the distance vector of v and uses the Bellman-Ford
equation to update its own distance vector. The equation is given below:
dx(y) = minv{ c(x,v) + dv(y)} for each node y in N
where the minv is the equation taken for all x neighbours. After traveling from x to v, if we
consider the least-cost path from v to y, the path cost will be c(x,v)+dv(y). The least cost from
x to y is the minimum of c(x,v)+dv(y) taken over all neighbours.

Example

9
1 B E

A 3 2

5 C D
4

158
From source B

B to A B to C B to E B to D
B-A →1 B-C →3 B-E →9 B-E-D →11
B-C-A→8 B-E-D-C→15 B-C-D-E→9 B-C-D→7
B-E-D-C-A→20 B-A-C→6 B-A-C-D-E→12 B-A-C-D→10

Destination Cost Next hop


A 1 A
C 3 C
E 9 E
D 7 C It is the routing table for B

Link State Routing


It is a dynamic routing algorithm in which each router shares knowledge of its neighbors
with every other router in the network. A router sends its information about its neighbors
only to all the routers through flooding. Information sharing takes place only whenever
there is a change. It makes use of Dijkastra’s Algorithm for making routing tables.

Example
15
A B

8
1
5

D C
4

159
A B
B 15
A 15
D 5
D 8
15 C 1
A B

8
1
5

D C
D 4 C
A 5 D 4
B 8 B 1
C 4

At A
15
15 A B
A B
8
1
5
5
D C
D

15
A B

8
1
5

D C
4

Now uses Dijkastra’s Algorithm for finding shortest path


Let the source be A
Step Additional node Set of remaining node Distance from source to
B, C, D
Initialization A (B, C, D) [15, ∞, 5]
1 D (B, C) [13, 9, 5]
2 C (B) [10, 9, 5]

160
For minimum distance from A, node B is accessed through D and C, node C is accessed
through D, node D is accessed directly.

Difference between Distance vector routing and Link state routing


Distance Vector Routing Link State Routing
1. Bandwidth required is less due to local 1. Bandwidth required is more due to
sharing, small packets and no flooding. flooding and sending of large link state
packets.
2. Based on local knowledge since it 2. Based on global knowledge i.e it have
updates table based on information from knowledge about entire network.
neighbors.
3. Make use of Bellman Ford algorithm. 3. Make use of Dijkastra’s Algorithm.
4. Traffic is less. 4. Traffic is more.
5. Count to infinity problem. 5. No count to infinity problem.
6. Persistent looping problem i.e loop will 6. No persistent loop, only transient loops.
there forever.
7. Practical implementation is RIP and 7. Practical implementation is OSPF and
IGRP. ISIS.

Routing Protocols

Routing Protocols are the set of defined rules used by the routers to communicate between
source & destination. They do not move the information to the source to a destination, but only
update the routing table that contains the information.

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

Open Shortest Path First. (OSPF)


The OSPF stands for Open Shortest Path First. It is a widely used and supported routing
protocol. It is an intradomain protocol, which means that it is used within an area or a network.
It is an interior gateway protocol that has been designed within a single autonomous system. It
is based on a link-state routing algorithm in which each router contains the information of every
domain, and based on this information, it determines the shortest path. The goal of routing is
to learn routes. The OSPF achieves by learning about every router and subnet within the entire
network. Every router contains the same information about the network. The way the router
learns this information by sending LSA (Link State Advertisements). These LSAs contain
information about every router, subnet, and other networking information. Once the LSAs have
been flooded, the OSPF stores the information in a link-state database known as LSDB. The
main goal is to have the same information about every router in an LSDBs.

How OSPF works?

Step 1: The first step is to become OSPF neighbors. The two connecting routers running OSPF
on the same link creates a neighbor relationship.

Step 2: The second step is to exchange database information. After becoming the neighbors,
the two routers exchange the LSDB information with each other.

161
Step 3: The third step is to choose the best route. Once the LSDB information has been
exchanged with each other, the router chooses the best route to be added to a routing table
based on the calculation of SPF

Border Gateway Protocol (BGP)


Border Gateway Protocol (BGP) is used to Exchange routing information for the internet and
is the protocol used between ISP which are different ASes.
The protocol can connect together any internetwork of autonomous system using an arbitrary
topology. The only requirement is that each AS have at least one router that is able to run BGP
and that is router connect to at least one other AS’s BGP router. BGP’s main function is to
exchange network reach-ability information with other BGP systems. Border Gateway
Protocol constructs an autonomous systems’ graph based on the information exchanged
between BGP routers.
Characteristics of Border Gateway Protocol (BGP):

 Inter-Autonomous System Configuration: The main role of BGP is to provide


communication between two autonomous systems.
 BGP supports Next-Hop Paradigm.
 Coordination among multiple BGP speakers within the AS (Autonomous System).
 Path Information: BGP advertisement also include path information, along with the
reachable destination and next destination pair.
 Policy Support: BGP can implement policies that can be configured by the
administrator. For ex:- a router running BGP can be configured to distinguish between
the routes that are known within the AS and that which are known from outside the AS.
 Runs Over TCP.
 BGP conserve network Bandwidth.
 BGP supports CIDR.
 BGP also supports Security.

Difference between OSPF and BGP routing protocols


OSPF BGP
1. The OSPF will always search for the 1. BGP focuses in determining the best
fastest route, and not the shortest, in path for a datagram.
spite of its name.
2. OSPF is an internal gateway protocol. 2. BGP is an external gateway protocol.
3. OSPF is mainly used on smaller scale 3. The BGP protocol is mainly used on
networks that are centrally administered. very large scale networks like the
internet.
4. OSPF is comparatively easy to 4. BGP is comparatively complex to
implement. implement.
5. OSPF doesn’t scale up well as Routers 5. BGP scales up well because it sends a
using the OSPF protocol will verify the complete route update only once when a
status of the other routers to which they session is established.

162
have access, frequently sending a
message.
6. Dijkstra’s algorithm is suitable to 6. Best path algorithm is suitable to
implement OSPF routing protocol. implement BGP routing protocol.
7. Port number 89 used. 7. Port number 179 used.
8. Ip protocol is used. 8. TCP protocol is used.

Internet Control Protocols

Address Resolution Protocol (ARP)


ARP stands for Address Resolution Protocol, which is used to find the MAC address of the
device from its known IP address. This means, the source device already knows the IP address
but not the MAC address of the destination device. The MAC address of the device is required
because you cannot communicate with a device in a local area network (Ethernet) without
knowing its MAC address. So, the Address Resolution Protocol helps to obtain the MAC
address of the destination device.

The purpose of ARP is to convert the 32-bit logical address (IPv4 address) to the 48-bit physical
address (MAC address). This protocol works between layer 2 and layer 3 of the OSI model.
The MAC address resides at layer 2, which is also known as the data link layer and IP address
resides at layer 3, this layer is also known as the network layer.

Suppose two devices (device A and device B) want to communicate with each other. The device
A already knows the IP address of the Device B. But in order to communicate with the device
B, device A still needs the MAC address of the device B. The IP address is used to locate a
device on a local area network and the MAC address is used to identify the actual device. The
device A first look at its internal list known as ARP cache (table) to check if the IP address of
the device B already consists of its MAC address or not. If the ARP table consists of the MAC
address of the device B, then device A simply use that MAC address and start communication.

If the table does not consist of the MAC address of device B, then device A sends an ARP
broadcast message on the network to know which device has that specific IP address and ask
for the MAC address of that particular device. Then the device that has matching IP address to
the source address sends an ARP response message that consists of the MAC address of the
device B. When device A obtains the MAC address of the device B, it will store the information
in the ARP cache (table). The ARP cache is used to make the network more efficient. It stores
the IP address of the device along with its MAC address. The stored information is used when
device A wants to communicate with device B on a network, and it does not need to broadcast
a message on the network again. It will simply check the ARP cache for the entries and then
use it for communication.

163
Reverse Address Resolution Protocol (RARP)
Reverse ARP is a networking protocol used by a client machine in a local area network to
request its Internet Protocol address (IPv4) from the gateway-router’s ARP table. The
network administrator creates a table in gateway-router, which is used to map the MAC
address to corresponding IP address.
When a new machine is setup or any machine which don’t have memory to store IP address,
needs an IP address for its own use. So the machine sends a RARP broadcast packet which
contains its own MAC address in both sender and receiver hardware address field.
A special host configured inside the local area network, called as RARP-server is responsible
to reply for these kind of broadcast packets. Now the RARP server attempt to find out the
entry in IP to MAC address mapping table. If any entry matches in table, RARP server send
the response packet to the requesting device along with IP address.
 LAN technologies like Ethernet, Ethernet II, Token Ring and Fiber Distributed Data
Interface (FDDI) support the Address Resolution Protocol.
 RARP is not being used in today’s networks. Because we have much great featured
protocols like BOOTP (Bootstrap Protocol) and DHCP( Dynamic Host Configuration
Protocol).

164
Internet Control Message Protocol (ICMP)

It is a network layer protocol. It is used for error handling in the network layer, and it is
primarily used on network devices such as routers. As different types of errors can exist in the
network layer, so ICMP can be used to report these errors and to debug those errors.

For example, some sender wants to send the message to some destination, but the router
couldn't send the message to the destination. In this case, the router sends the message to the
sender that I could not send the message to that destination.

The IP protocol does not have any error-reporting or error-correcting mechanism, so it uses a
message to convey the information. For example, if someone sends the message to the
destination, the message is somehow stolen between the sender and the destination. If no one
reports the error, then the sender might think that the message has reached the destination. If
someone in-between reports the error, then the sender will resend the message very quickly.

ICMP messages are of two types:

1. Error-reporting messages

The error-reporting message means that the router encounters a problem when it processes
an IP packet then it reports a message.

2. Query messages

The query messages are those messages that help the host to get the specific information of
another host. For example, suppose there are a client and a server, and the client wants to
know whether the server is live or not, then it sends the ICMP message to the server.

ICMP Message Format

The message format has two things; one is a category that tells us which type of message it is.
If the message is of error type, the error message contains the type and the code. The type
defines the type of message while the code defines the subtype of the message.

The ICMP message contains the following fields:

165
o Type: It is an 8-bit field. It defines the ICMP message type. The values range from 0
to 127 are defined for ICMPv6, and the values from 128 to 255 are the informational
messages.
o Code: It is an 8-bit field that defines the subtype of the ICMP message
o Checksum: It is a 16-bit field to detect whether the error exists in the message or not

166
Unit-5
The Transport Layer
Introduction

Transport layer is responsible for end-to-end delivery over a network. Whereas the network
layer is concerned with the end - to- end delivery of individual packets and it does not
recognize any relationship between those packets.

 This layer treats each packet independently because each packet belongs to a different
message.
 The transport layer ensures that each message should reach its destination
completely and in order so that it maintains error and flow control to the source to
destination to ensure proper data transmission.
 The transport layer establishes a connection between two end ports. A connection is
a single logical path from source to destination which is associated with all the
packets in a message.
 Transport Layer uses some standard protocols to enhance its functionalities are
TCP(Transmission Control Protocol), UDP( User Datagram Protocol), DCCP(
Datagram Congestion Control Protocol), etc.

Functions of Transport Layer

1. Service-point addressing

 Computers often run many programs at the same time. Due to this, source-to-
destination delivery means delivery from a specific job (currently running program)
on one computer to a specific job (currently running program) on the other system not
only one computer to the next.
 For this reason, the transport layer added a specific type of address to its header, it is
referred to as a service point address or port address.
 By this address each packet reaches the correct computer and also the transport
layer gets the complete message to the correct process on that computer.

167
2. Segmentation and Reassembly

 In segmentation, a message is divided into transmittable segments; each segment


containing a sequence number. This number enables this layer to reassemble the
message.
 Upon arriving at its destination system message is reassembled correctly, identify and
replaces packets that were lost in transmission.

3. Connection Control

It can be either of two types:

i. Connectionless Transport Layer


ii. Connection Oriented Transport Layer

i. Connectionless Transport Layer

 This Transport Layer treats each packet as an individual and delivers it to the
destination machine.
 In this type of transmission, the receiver does not send an acknowledgment to the
sender about the receipt of a packet. This is a faster communication technique.

ii. Connection Oriented Transport Layer

 This Transport Layer creates a connection with the Transport Layer at the
destination machine before transmitting the packets to the destination.
 To Create a connection following three steps are possible:
o Connection establishment
o Data transfer
o Connection termination

When all the data are transmitted connection is terminated. Connectionless Service is less
reliable than connection Oriented Service.

4. Multiplexing and Demultiplexing

 Multiple packets from diverse applications are transmitted across a network needs
very dedicated control mechanisms, which are found in the transport layer.
 The transport layer accepts packets from different processes. These packets are
differentiated by their port numbers and pass them to the network layer after adding
proper headers.
 In Demultiplexing, at the receiver's side to obtain the data coming from various
processes. It receives the segments of data from the network layer and delivers it to
the appropriate process running on the receiver's machine.

5. Flow control

 The transport layer also responsible for the flow control mechanism between the
adjacent layers of the TCP/IP model.
 It does not perform across a single link even it performs an end-to-end node.

168
 By imposing flow control techniques data loss can be prevented from the cause of the
sender and slow receiver.
 For instance, it uses the method of sliding window protocol in this method receiver
sends a window back to the sender to inform the size of the data is received.

6. Error Control

 Error Control is also performed end to end like the data link layer.
 In this layer to ensure that the entire message arrives at the receiving transport layer
without any error (damage, loss or duplication). Error Correction is achieved through
retransmission of the packet.
 The data has arrived or not and checks for the integrity of data, it uses the ACK and
NACK services to inform the sender.

User Datagram Protocol (UDP)


The User Datagram Protocol (UDP) is simplest Transport Layer communication protocol
available of the TCP/IP protocol suite. It involves minimum amount of communication
mechanism. UDP is said to be an unreliable transport protocol but it uses IP services which
provides best effort delivery mechanism.
In UDP, the receiver does not generate an acknowledgement of packet received and in turn,
the sender does not wait for any acknowledgement of packet sent. This shortcoming makes
this protocol unreliable as well as easier on processing.

Features

 UDP is used when acknowledgement of data does not hold any significance.
 UDP is good protocol for data flowing in one direction.
 UDP is simple and suitable for query based communications.
 UDP is not connection oriented.
 UDP does not provide congestion control mechanism.
 UDP does not guarantee ordered delivery of data.
 UDP is stateless.
 UDP is suitable protocol for streaming applications such as VoIP, multimedia
streaming.
UDP Header

169
UDP header contains four main parameters:
 Source Port - This 16 bits information is used to identify the source port of the packet.
 Destination Port - This 16 bits information, is used identify application level service
on destination machine.
 Length - Length field specifies the entire length of UDP packet (including header). It
is 16-bits field and minimum value is 8-byte, i.e. the size of UDP header itself.
 Checksum - This field stores the checksum value generated by the sender before
sending. IPv4 has this field as optional so when checksum field does not contain any
value it is made 0 and all its bits are set to zero.
How UDP works?
UDP uses IP to get a datagram from one computer to another. UDP works by gathering data
in a UDP packet and adding its own header information to the packet. This data consists of
the source and destination ports to communicate on, the packet length and a checksum. After
UDP packets are encapsulated in an IP packet, they're sent off to their destinations.
Unlike TCP, UDP doesn't guarantee that the packets will get to the right destinations. That
means that UDP doesn't connect to the receiving computer directly -- which TCP does. Rather,
it sends the data out and relies on the devices in between the sending and receiving computers
to correctly get the data where it's supposed to go.
Most applications that use UDP wait for any replies that are expected as a result of packets
sent using the communication protocol. If an application doesn't receive a reply within a
certain time frame, the application sends the packet again, or it stops trying.
UDP uses a simple transmission model that doesn't include handshaking dialogues to provide
reliability, ordering or data integrity. Consequently, UDP's service is unreliable, and packets
may arrive out of order, appear to have duplicates or disappear without warning.
Although this transmission method doesn't guarantee that the data being sent will reach its
destination, it does have low overhead, and it's popular for services that don't absolutely have
to work the first time.

170
Applications of UDP
 Used for simple request response communication when size of data is less and hence
there is lesser concern about flow and error control.
 It is suitable protocol for multicasting as UDP supports packet switching.
 UDP is used for some routing update protocols like RIP (Routing Information
Protocol).
 Normally used for real time applications which cannot tolerate uneven delays between
sections of a received message.
 Following implementations uses UDP as a transport layer protocol:
 NTP (Network Time Protocol)
 DNS (Domain Name Service)
 BOOTP, DHCP.
 NNP (Network News Protocol)
 Quote of the day protocol
 TFTP, RTSP, RIP.
 Application layer can do some of the tasks through UDP-
 Trace Route
 Record Route
 Time stamp

Remote Procedure Call (RPC)


A common pattern of communication used by application programs structured as
a client/server pair is the request/reply message transaction: A client sends a request message
to a server, and the server responds with a reply message, with the client blocking (suspending
execution) to wait for the reply.

Fig: Timeline for RPC


A transport protocol that supports the request/reply paradigm is much more than a UDP
message going in one direction followed by a UDP message going in the other direction. It
needs to deal with correctly identifying processes on remote hosts and correlating requests with
responses. It may also need to overcome some or all of the limitations of the underlying
network outlined in the problem statement at the beginning of this chapter. While TCP
overcomes these limitations by providing a reliable byte-stream service, it doesn’t perfectly
match the request/reply paradigm either. This section describes a third category of transport

171
protocol, called Remote Procedure Call (RPC), that more closely matches the needs of an
application involved in a request/reply message exchange.

Transmission Control Protocol (TCP)

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.

Features of TCP
 TCP is reliable protocol. That is, the receiver always sends either positive or negative
acknowledgement about the data packet to the sender, so that the sender always has
bright clue about whether the data packet is reached the destination or it needs to
resend it.
 TCP ensures that the data reaches intended destination in the same order it was sent.
 TCP is connection oriented. TCP requires that connection between two remote points
be established before sending actual data.
 TCP provides error-checking and recovery mechanism.
 TCP provides end-to-end communication.
 TCP provides flow control and quality of service.
 TCP operates in Client/Server point-to-point mode.
 TCP provides full duplex server, i.e. it can perform roles of both receiver and sender.
TCP Segment Header
1. Process-to-Process Communication –
TCP provides process to process communication, i.e, the transfer of data takes place
between individual processes executing on end systems. This is done using port
numbers or port addresses. Port numbers are 16 bit long that help identify which
process is sending or receiving data on a host.
2. Stream oriented –
This means that the data is sent and received as a stream of bytes(unlike UDP or IP that
divides the bits into datagrams or packets). However, the network layer, that provides
service for the TCP, sends packets of information not streams of bytes. Hence, TCP
groups a number of bytes together into a segment and adds a header to each of these
segments and then delivers these segments to the network layer. At the network layer,
each of these segments are encapsulated in an IP packet for transmission. The TCP

172
header has information that is required for control purpose which will be discussed
along with the segment structure.
3. Full duplex service –
This means that the communication can take place in both directions at the same time.
4. Connection oriented service –
Unlike UDP, TCP provides connection oriented service. It defines 3 different phases:
 Connection establishment
 Data transfer
 Connection termination
(IMP: This is a virtual connection, not a physical connection, means during the
transmission the resources will not be reserved and the segments will not follow the
same path to reach the destination but it is a connection orientation in the sense that
segments will arrive in order by the help of sequence number.)
5. Reliability –
TCP is reliable as it uses checksum for error detection, attempts to recover lost or
corrupted packets by re-transmission, acknowledgement policy and timers. It uses
features like byte number and sequence number and acknowledgement number so as to
ensure reliability. Also, it uses congestion control mechanisms.
6. Multiplexing –
TCP does multiplexing and de-multiplexing at the sender and receiver ends respectively
as a number of logical connections can be established between port numbers over a
physical connection.

TCP Segment Header

173
TCP segment consists of data bytes to be sent and a header that is added to the data by TCP
as shown above:
The header of a TCP segment can range from 20-60 bytes. 40 bytes are for options. If there
are no options, header is of 20 bytes else it can be of upmost 60 bytes.
Header fields:
 Source Port Address –
16 bit field that holds the port address of the application that is sending the data
segment.
 Destination Port Address –
16 bit field that holds the port address of the application in the host that is receiving the
data segment.
 Sequence Number –
32 bit field that holds the sequence number, i.e, the byte number of the first byte that is
sent in that particular segment. It is used to reassemble the message at the receiving end
if the segments are received out of order.
 Acknowledgement Number –
32 bit field that holds the acknowledgement number, i.e, the byte number that the
receiver expects to receive next. It is an acknowledgment for the previous bytes being
received successfully.
 Header Length (HLEN) –
This is a 4 bit field that indicates the length of the TCP header by number of 4-byte
words in the header, i.e, if the header is of 20 bytes(min length of TCP header), then
this field will hold 5 (because 5 x 4 = 20) and the maximum length: 60 bytes, then it’ll
hold the value 15(because 15 x 4 = 60). Hence, the value of this field is always between
5 and 15.
 Control flags –
These are 6 1-bit control bits that control connection establishment, connection
termination, connection abortion, flow control, mode of transfer etc. Their function is:
 URG: Urgent pointer is valid
 ACK: Acknowledgement number is valid( used in case of cumulative
acknowledgement)
 PSH: Request for push
 RST: Reset the connection
 SYN: Synchronize sequence numbers
 FIN: Terminate the connection
 Window size –
This field tells the window size of the sending TCP in bytes.
 Checksum –
This field holds the checksum for error control. It is mandatory in TCP as opposed to
UDP.
 Urgent pointer –
This field (valid only if the URG control flag is set) is used to point to data that is
urgently required that needs to reach the receiving process at the earliest. The value of
this field is added to the sequence number to get the byte number of the last urgent byte.

174
Congestion Control
Congestion is an important issue that can arise in packet switched network. Congestion is a
situation in Communication Networks in which too many packets are present in a part of the
subnet, performance degrades. Congestion in a network may occur when the load on the
network (i.e. the number of packets sent to the network) is greater than the capacity of the
network (i.e. the number of packets a network can handle.) In other words when too much
traffic is offered, congestion sets in and performance degrades sharply.

Causing of Congestion:

The various causes of congestion in a subnet are:


1. The input traffic rate exceeds the capacity of the output lines. If suddenly, a stream of
packet start arriving on three or four input lines and all need the same output line. In
this case, a queue will be built up. If there is insufficient memory to hold all the packets,
the packet will be lost. Increasing the memory to unlimited size does not solve the
problem. This is because, by the time packets reach front of the queue, they have already
timed out (as they waited the queue). When timer goes off source transmits duplicate
packet that are also added to the queue. Thus same packets are added again and again,
increasing the load all the way to the destination.

2. The routers are too slow to perform bookkeeping tasks (queuing buffers, updating
tables, etc.).
3. The routers' buffer is too limited.
4. Congestion in a subnet can occur if the processors are slow. Slow speed CPU at routers
will perform the routine tasks such as queuing buffers, updating table etc. slowly. As a
result of this, queues are built up even though there is excess line capacity.

175
5. Congestion is also caused by slow links. This problem will be solved when high speed
links are used. But it is not always the case. Sometimes increase in link bandwidth can
further deteriorate the congestion problem as higher speed links may make the network
more unbalanced. Congestion can make itself worse. If a route!" does not have free
buffers, it start ignoring/discarding the newly arriving packets. When these packets are
discarded, the sender may retransmit them after the timer goes off. Such packets are
transmitted by the sender again and again until the source gets the acknowledgement of
these packets. Therefore multiple transmissions of packets will force the congestion to
take place at the sending end.

How to Correct the Congestion Problem:

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.

These two categories are:

1. Open Loop Congestion Control:

In this method, policies are used to prevent the congestion before it happens. Congestion
control is handled either by the source or by the destination. The various methods used for open
loop congestion control are:
1. 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.

176
2. Window Policy
 To implement window policy, selective reject window method is used for congestion
control.
 Selective Reject method is preferred over Go-back-n window as in Go-back-n method,
when timer for a packet times out, several packets are resent, although some may have
arrived safely at the receiver. Thus, this duplication may make congestion worse.
 Selective reject method sends only the specific lost or damaged packets.
3. 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.
 To implement it, several approaches can be used:
 A receiver may send an acknowledgement only if it has a packet to be sent.
 A receiver may send an acknowledgement when a timer expires.
 A receiver may also decide to acknowledge only N packets at a time.

4. 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.

5. Admission Policy:
 An admission policy, which is a quality-of-service mechanism, can also prevent
congestion in virtual circuit networks.
 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.

2. Closed Loop Congestion Control:

Closed loop congestion control mechanisms try to remove the congestion after it happens. The
various methods used for closed loop congestion control are:

177
1. Backpressure:
 Backpressure 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.
 In 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 figure 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.

2. 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 travelled are not warned.

3. Implicit Signaling:
 In implicit signaling, there is no communication between the congested node or nodes
and the source.

178
 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.
 On sensing this congestion, the source slows down.
 This type of congestion control policy is used by TCP.

4. 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.

Congestion Control Algorithms:

1. Leaky Bucket Algorithm:

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. Imagine a bucket with a small hole at the bottom. 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.

179
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.

2. Token Bucket Algorithm:

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 form of tokens.

180
For example, if a system generates 100 tokens in one clock tick and the host is idle for 100
ticks. 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 for sending 10,000 cells or bytes. Thus a host can send
bursty data as long as bucket is not empty.

181
Unit- 6
The Application Layer
It is the top most layer of OSI Model. Manipulation of data(information) in various ways is
done in this layer which enables user or software to get access to the network. Some services
provided by this layer includes: E-Mail, transferring files, distributing the results to user,
directory services, network resources, etc.

The Application Layer contains a variety of protocols that are commonly needed by users. One
widely-used application protocol is HTTP (HyperText Transfer Protocol), which is the basis
for the World Wide Web. When a browser wants a web page, it sends the name of the page it
wants to the server using HTTP. The server then sends the page back.

Other Application protocols that are used are: File Transfer Protocol (FTP), Trivial File
Transfer Protocol(TFTP), Simple Mail Transfer Protocol(SMTP), TELNET, Domain Name
System(DNS) etc.

Functions of application layer

1. Mail Services: This layer provides the basis for E-mail forwarding and storage.

2. Network Virtual Terminal: It allows a user to log on to a remote host. The application
creates software emulation of a terminal at the remote host. User's computer talks to
the software terminal which in turn talks to the host and vice versa. Then the remote
host believes it is communicating with one of its own terminals and allows user to log
on.

3. Directory Services: This layer provides access for global information about various
services.

4. File Transfer, Access and Management (FTAM): It is a standard mechanism to access


files and manages it. Users can access files in a remote computer and manage it. They
can also retrieve files from a remote computer.

182
Application layer protocols

Domain Name System (DNS)

An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.

o DNS stands for Domain Name System.


o DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a sequence of
symbols specified by dots.
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 [Link],
most people would reach this site by specifying [Link]. 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

o It defines the registered hosts according to their generic behavior.


o Each node in a tree defines the domain name, which is an index to the DNS database.
o It uses three-character labels, and these labels describe the organization type.

183
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 DNS is a client/server network communication protocol. DNS clients send requests to


the. server while DNS servers send responses to the client.

184
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.

Dynamic Host Configuration Protocol (DHCP)


Dynamic Host Configuration Protocol (DHCP) is a network management protocol used to
dynamically assign an IP address to any device, or node, on a network so they can communicate
using IP (Internet Protocol). DHCP automates and centrally manages these configurations.
There is no need to manually assign IP addresses to new devices. Therefore, there is no
requirement for any user configuration to connect to a DHCP based network.

DHCP can be implemented on local networks as well as large enterprise networks. DHCP is
the default protocol used by the most routers and networking equipment. DHCP is also called
RFC (Request for comments) 2131.

DHCP does the following:


o DHCP manages the provision of all the nodes or devices added or dropped from the
network.
o DHCP maintains the unique IP address of the host using a DHCP server.
o It sends a request to the DHCP server whenever a client/node/device, which is
configured to work with DHCP, connects to a network. The server acknowledges by
providing an IP address to the client/node/device.

DHCP is also used to configure the proper subnet mask, default gateway and DNS server
information on the node or device.

There are many versions of DCHP are available for use in IPV4 (Internet Protocol Version 4)
and IPV6 (Internet Protocol Version 6).

How DHCP works?

DHCP runs at the application layer of the TCP/IP protocol stack to dynamically assign IP
addresses to DHCP clients/nodes and to allocate TCP/IP configuration information to the
DHCP clients. Information includes subnet mask information, default gateway, IP addresses
and domain name system addresses.

185
DHCP is based on client-server protocol in which servers manage a pool of unique IP
addresses, as well as information about client configuration parameters, and assign addresses
out of those address pools.

Components of DHCP

When working with DHCP, it is important to understand all of the components. Following are
the list of components:

o DHCP Server: DHCP server is a networked device running the DCHP service that holds
IP addresses and related configuration information. This is typically a server or a router
but could be anything that acts as a host, such as an SD-WAN appliance.
o DHCP client: DHCP client is the endpoint that receives configuration information from
a DHCP server. This can be any device like computer, laptop, IoT endpoint or anything
else that requires connectivity to the network. Most of the devices are configured to
receive DHCP information by default.
o IP address pool: IP address pool is the range of addresses that are available to DHCP
clients. IP addresses are typically handed out sequentially from lowest to the highest.
o Subnet: Subnet is the partitioned segments of the IP networks. Subnet is used to keep
networks manageable.
o Lease: Lease is the length of time for which a DHCP client holds the IP address
information. When a lease expires, the client has to renew it.
o DHCP relay: A host or router that listens for client messages being broadcast on that
network and then forwards them to a configured server. The server then sends responses
back to the relay agent that passes them along to the client. DHCP relay can be used to
centralize DHCP servers instead of having a server on each subnet.

Benefits of DHCP

There are following benefits of DHCP:

Centralized administration of IP configuration: DHCP IP configuration information can be


stored in a single location and enables that administrator to centrally manage all IP address
configuration information.

Dynamic host configuration: DHCP automates the host configuration process and eliminates
the need to manually configure individual host. When TCP/IP (Transmission control
protocol/Internet protocol) is first deployed or when IP infrastructure changes are required.

Seamless IP host configuration: The use of DHCP ensures that DHCP clients get accurate and
timely IP configuration IP configuration parameter such as IP address, subnet mask, default
gateway, IP address of DND server and so on without user intervention.

186
Flexibility and scalability: Using DHCP gives the administrator increased flexibility, allowing
the administrator to move easily change IP configuration when the infrastructure changes.

World Wide Web (WWW)


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., [Link], [Link], 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.

Hyper Text Transfer Protocol (HTTP)

o HTTP stands for HyperText Transfer Protocol.


o It is a protocol used to access the data on the World Wide Web (www).
o The HTTP protocol can be used to transfer the data in the form of plain text, hypertext,
audio, video, and so on.
o This protocol is known as HyperText Transfer Protocol because of its efficiency that
allows us to use in a hypertext environment where there are rapid jumps from one
document to another document.
o HTTP is similar to the FTP as it also transfers the files from one host to another host.
But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control
connection to transfer the files.

187
o HTTP is used to carry the data in the form of MIME-like format.
o HTTP is similar to SMTP as the data is transferred between client and server. The
HTTP differs from the SMTP in the way the messages are sent from the client to the
server and from server to the client. SMTP messages are stored and forwarded while
HTTP messages are delivered immediately.

Features of HTTP:

o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a


request and waits for a response from the server. When the server receives the request,
the server processes the request and sends back the response to the HTTP client after
which the client disconnects the connection. The connection between client and server
exist only during the current request and response time only.
o Media independent: HTTP protocol is a media independent as data can be sent as long
as both the client and server know how to handle the data content. It is required for both
the client and server to specify the content type in MIME-type header.
o Stateless: HTTP is a stateless protocol as both the client and server know each other
only during the current request. Due to this nature of the protocol, both the client and
server do not retain the information between various requests of the web pages.

HTTP Transaction

The above figure shows the HTTP transaction between client and server. The client initiates a
transaction by sending a request message to the server. The server replies to the request
message by sending a response message.

188
Messages

HTTP messages are of two types: request and response. Both the message types follow the
same message format.

Request Message: The request message is sent by the client that consists of a request line,
headers, and sometimes a body.

Response Message: The response message is sent by the server to the client that consists of a
status line, headers, and sometimes a body.

Hyper Text Transfer Protocol Secure (HTTPS)

189
HTTPS is an abbreviation of Hypertext Transfer Protocol Secure. It is a secure extension or
version of HTTP. This protocol is mainly used for providing security to the data sent between
a website and the web browser. It is widely used on the internet and used for secure
communications. This protocol uses the 443 port number for communicating the data.

This protocol is also called HTTP over SSL because the HTTPS communication protocols are
encrypted using the SSL (Secure Socket Layer).

By default, it is supported by various web browsers.

Those websites which need login credentials should use the HTTPS protocol for sending the
data.

It allows users to create a secured encrypted connection and helps them to protect their
information from being stolen.

Advantages of HTTPS

Following are the advantages or benefits of a Hypertext Transfer Protocol Secure (HTTPS):

o Data and information are protected. So, it ensures data protection.


o SSL technology in HTTPS protects the data from third-party or hackers. And this
technology builds trust for the users who are using it.
o It helps users by performing banking transactions.

Disadvantages of HTTPS

o The big disadvantage of HTTPS is that users need to purchase the SSL certificate.
o The speed of accessing the website is slow because there are various complexities in
communication.
o Users need to update all their internal links

Difference between HTTP and HTTPS

HTTP HTTPS

190
1. It is an abbreviation of Hypertext 1. It is an abbreviation of Hypertext Transfer
Transfer Protocol Protocol Secure.

2. This protocol operates at the application 2. This protocol operates at the transport
layer. layer.

3. The data which is transferred in HTTP 3. The data which is transferred in HTTPS is
is plain text. encrypted, i.e., ciphertext.

4. By default, this protocol operates on 4. By default, this protocol operates on port


port number 80. number 443.

5. The URL (Uniform Resource Locator) 5. The URL (Uniform Resource Locator) of
of HTTP start with http:// HTTPS start with https://

6. This protocol does not need any 6. But, this protocol requires an SSL (Secure
certificate. Socket Layer) certificate.

7. Encryption technique is absent in 7. Encryption technique is available or


HTTP. present in HTTPS.

8. The speed of HTTP is fast as compared 8. The speed of HTTPS is slow as compared
to HTTPS. to HTTP.

9. It is un-secure. 9. It is highly secure.

10. Examples of HTTP websites are 10. Examples of HTTPS websites are
Educational Sites, Internet Forums, etc. shopping websites, banking websites, etc.

Terminal Network (TELNET)

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

191
o Telnet provides a connection to the remote computer in such a way that a local terminal
appears to be at the remote side.

There are two types of login:


Local Login

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

192
Remote login

o When the user wants to access an application program on a remote computer,


then the user must perform remote login.

How remote login occurs


At the local site

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

At the remote site

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

193
File Transfer Protocol (FTP)

o FTP stands for File transfer protocol.


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

Objectives of FTP

o It provides the sharing of files.


o It is used to encourage the use of remote computers.
o It transfers the data more reliably and efficiently.

Why FTP?

Although transferring files from one system to another is very simple and straightforward, but
sometimes it can cause problems. For example, two systems may have different file
conventions. Two systems may have different ways to represent text and data. Two systems
may have different directory structures. FTP protocol overcomes these problems by
establishing two connections between hosts. One connection is used for data transfer, and
another connection is used for the control connection.

Mechanism of FTP

194
The above figure shows the basic model of the FTP. The FTP client has three components: the
user interface, control process, and data transfer process. The server has two components: the
server control process and the server data transfer process.

There are two types of connections in FTP:

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

FTP Clients
o FTP client is a program that implements a file transfer protocol which allows you to
transfer files between two hosts on the internet.
o It allows a user to connect to a remote host and upload or download the files.
o It has a set of commands that we can use to connect to a host, transfer the files between
you and your host and close the connection.
o The FTP program is also available as a built-in component in a Web browser. This GUI
based FTP client makes the file transfer very easy and also does not require to remember
the FTP commands.

Advantages of FTP:
o Speed: One of the biggest advantages of FTP is speed. The FTP is one of the fastest
way to transfer the files from one computer to another computer.

195
o Efficient: It is more efficient as we do not need to complete all the operations to get
the entire file.
o Security: To access the FTP server, we need to login with the username and password.
Therefore, we can say that FTP is more secure.
o Back & forth movement: FTP allows us to transfer the files back and forth. Suppose
you are a manager of the company, you send some information to all the employees,
and they all send information back on the same server.

Disadvantages of FTP:
o The standard requirement of the industry is that all the FTP transmissions should be
encrypted. However, not all the FTP providers are equal and not all the providers offer
encryption. So, we will have to look out for the FTP providers that provides encryption.
o FTP serves two operations, i.e., to send and receive large files on a network. However,
the size limit of the file is 2GB that can be sent. It also doesn't allow you to run
simultaneous transfers to multiple receivers.
o Passwords and file contents are sent in clear text that allows unwanted eavesdropping.
So, it is quite possible that attackers can carry out the brute force attack by trying to
guess the FTP password.
o It is not compatible with every system.

Simple Mail Transfer Protocol (SMTP)

o SMTP is a set of communication guidelines that allow software to transmit an electronic


mail over the internet is called Simple Mail Transfer Protocol.
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:
o It can send a single message to one or more recipients.
o Sending message can include text, voice, video or graphics.
o It can also send the messages on networks outside the internet.
o The main purpose of SMTP is used to set up communication rules between servers. The
servers have a way of identifying themselves and announcing what kind of
communication they are trying to perform. They also have a way of handling the errors
such as incorrect email address. For example, if the recipient address is wrong, then
receiving server reply with an error message of some kind.

196
Components of SMTP

o First, we will break the SMTP client and SMTP server into two components such as
user agent (UA) and mail transfer agent (MTA). The user agent (UA) prepares the
message, creates the envelope and then puts the message in the envelope. The mail
transfer agent (MTA) transfers this mail across the internet.

o SMTP allows a more complex system by adding a relaying system. Instead of just
having one MTA at sending side and one at receiving side, more MTAs can be added,
acting either as a client or server to relay the email.

197
o The relaying system without TCP/IP protocol can also be used to send the emails to
users, and this is achieved by the use of the mail gateway. The mail gateway is a relay
MTA that can be used to receive an email.

Working of SMTP

1. Composition of Mail: A user sends an e-mail by composing an electronic mail message


using a Mail User Agent (MUA). Mail User Agent is a program which is used to send
and receive mail. The message contains two parts: body and header. The body is the
main part of the message while the header includes information such as the sender and
recipient address. The header also includes descriptive information such as the subject
of the message. In this case, the message body is like a letter and header is like an
envelope that contains the recipient's address.

198
2. Submission of Mail: After composing an email, the mail client then submits the
completed e-mail to the SMTP server by using SMTP on TCP port 25.
3. Delivery of Mail: E-mail addresses contain two parts: username of the recipient and
domain name. For example, vivek@[Link], where "vivek" is the username of the
recipient and "[Link]" is the domain name. If the domain name of the recipient's
email address is different from the sender's domain name, then MSA will send the mail
to the Mail Transfer Agent (MTA). To relay the email, the MTA will find the target
domain. It checks the MX record from Domain Name System to obtain the target
domain. The MX record contains the domain name and IP address of the recipient's
domain. Once the record is located, MTA connects to the exchange server to relay the
message.
4. Receipt and Processing of Mail: Once the incoming message is received, the exchange
server delivers it to the incoming server (Mail Delivery Agent) which stores the e-mail
where it waits for the user to retrieve it.
5. Access and Retrieval of Mail: The stored email in MDA can be retrieved by using MUA
(Mail User Agent). MUA can be accessed by using login and password.

Post Office Protocol (POP)


The POP protocol stands for Post Office Protocol. As we know that SMTP is used as a message
transfer agent. When the message is sent, then SMPT is used to deliver the message from the
client to the server and then to the recipient server. But the message is sent from the recipient
server to the actual server with the help of the Message Access Agent. The Message Access
Agent contains two types of protocols, i.e., POP3 and IMAP.

How is mail transmitted?

Suppose sender wants to send the mail to receiver. First mail is transmitted to the sender's mail
server. Then, the mail is transmitted from the sender's mail server to the receiver's mail server
over the internet. On receiving the mail at the receiver's mail server, the mail is then sent to the
user. The whole process is done with the help of Email protocols. The transmission of mail
from the sender to the sender's mail server and then to the receiver's mail server is done with

199
the help of the SMTP protocol. At the receiver's mail server, the POP or IMAP protocol takes
the data and transmits to the actual user.

Since SMTP is a push protocol so it pushes the message from the client to the server. As we
can observe in the above figure that SMTP pushes the message from the client to the recipient's
mail server. The third stage of email communication requires a pull protocol, and POP is a pull
protocol. When the mail is transmitted from the recipient mail server to the client which means
that the client is pulling the mail from the server.

What is POP3?

The POP3 is a simple protocol and having very limited functionalities. In the case of the POP3
protocol, the POP3 client is installed on the recipient system while the POP3 server is installed
on the recipient's mail server.

Internet Message Access Protocol (IMAP)

IMAP is an internet protocol that works on managing and retrieving emails on the remote
server from a local client. It also works as MAA or Message Accessing Agent. Since IMAP
deals with the retrieval of messages so we can't send emails using IMAP protocol on the
internet. The IMAP protocol is supported by all email clients and web servers.

The working of IMAP is shown in below image:

When to use IMAP?

If you are accessing your email from different devices like mobile, laptop and workstation
desktop, etc., then it always better to use the IMAP protocol.

200
Features of IMAP

There are some features of IMAP, which are as follows:

o Emails are stored on the server instead of an email client.


o Sent messages are also stored on the server-side in the sent folder, which allows us to
check the sent email from anywhere.
o You can synchronize the messages and access youremail from multiple devices.
o It is more complex and flexible.
o It helps to download email data from AOL to your device or software.
o We will not lose our emails even if our device is destroyed or stolen.
o The server also saves the status of the emails, such as read, unread, or replied. It helps
to check the status of an email from any computer or device.
o When we start downloading emails using IMAP, it firstly shows the header (Sender,
date, email subject); at that instant, we can decide whether to download the email or
not.

Difference between IMAP and POP3

IMAP POP3

1. IMAP stands for Internet Message Access 1. It stands for Post Office Protocol3.
Protocol.

2. IMAP is an advanced protocol that allows 2. POP is a simple protocol compared to


a user to check all the folders on the mail IMAP and used only for downloading
server and is used to retrieve the mails. the messages from our inbox to the
local computer.

3. It listens on port number 143, and 3. It listens on port number 110, and
IMAPDS(IMAP with SSL) Listens on port POP3DS(POP3 with SSL) listens on
993. port 995.

4. Using IMAP, the messages can be accessed 4. Using POP3, mail can only be
using different devices. accessed using a single device at a
time.

5. We can partially read the message before 5. We can only read the message once it
finishing the download. is downloaded.

6. In IMAP, a mail can be updated using 6. In POP3, mail can be updated using
email software or a web interface. the local email software.

201
7. IMAP allows the user to create, delete, or 7. POP3 does not allow the user to create,
update the mailboxes on the mail server delete, or update the mailboxes on the
and also allows to create a hierarchy of mail server.
mailboxes in the folder.

8. It allows the user to organize the mails on 8. It does not allow to organize the mails
the server. on the server.

9. In IMAP, the message header is previewed 9. Using POP3, all the messages can be
before downloading a message. downloaded at once.

10. Emails are stored on a single device once 10. Emails are stored on the server and
they are downloaded and removed from the synced & can be accessed using
server. multiple devices.

Network Traffic Analyzer

Network traffic analysis is the process of intercepting, recording, and analyzing network traffic
communication patterns with the aim of detecting and responding to security threats. Network
traffic analysis may also be used to identify performance issues. Network traffic analyzers are
simply tools designed to enhance, streamline, and simplify the network traffic analysis process.

Network traffic analysis tools help identify the applications and protocols currently running on
the network, identifying bandwidth hogs (at the user, application, and device levels),
monitoring client-to-server network traffic, and troubleshooting network and application
performance problems.

Paessler Router Traffic Grapher (PRTG)

Paessler PRTG Network Monitor takes a sensor-based approach to network monitoring,


enabling you to create a solution to suit your individual needs. With PRTG, a sensor is a
monitoring element, with a single sensor typically dedicated to monitoring one measured
network value—for example, server CPU load, available disk drive space, or switch port traffic.
With thousands of sensors to choose from, you have the option of creating a specialized
network traffic monitoring tool or a more comprehensive network performance monitoring and
management solution.

PRTG provides a range of sensors for tracing and monitoring network traffic, including a
Traceroute Hop Count sensor, a Packet Sniffer sensor, NetFlow sensors, and SNMP sensors.

You can use up to 100 sensors for free with this tool, although you’ll need between five and
ten sensors per device (on average) or one sensor for every switch port. This means you’re
likely to use up these free sensors quickly.

Multi Router Traffic Grapher (MRTG)

MRTG is the Multi Router Traffic Grapher is free software released under the GNU General
Public License. It was written primarily by Tobias Oetiker and Dave Rand. It is written in Perl
202
and works on Unix/Linux as well as windows and even Netware systems. MRTG consists of a
Perl script which uses SNMP to read the traffic counters of your routers and a fast C program
which logs the traffic data and creates beautiful graphs representing the traffic on the monitored
network connection. These graphs are embedded into webpages which can be viewed from any
modern Web-browser.

MRTG builds daily, weekly, monthly and yearly graphs, so it’s a great tool for seeing trends
at a glance. This is possible because MRTG keeps a log of all the data it has pulled from the
router. This log is automatically consolidated so that it does not grow over time, but still
contains all the relevant data for all the traffic seen over the last two years. This is all performed
in an efficient manner. Therefore, you can monitor 200 or more network links from any halfway
decent UNIX box.

MRTG is not limited to monitoring traffic, though. It is possible to monitor any SNMP variable
you choose. You can even use an external program to gather the data which should be
monitored via MRTG. People are using MRTG, to monitor things such as System Load, Login
Sessions, Modern availability and more. MRTG even allows you to accumulate two or more
data sources into a single graph.

Simple Network Management Protocol (SNMP)

Simple Network Management Protocol is an Internet-standard protocol for handling devices


on IP networks. Devices that typically provide SNMP include routers, switches, servers,
workstations, printers, modem racks, and more. It is used mainly in the network management
framework to monitor network-attached computers for conditions requiring regulatory
attention.

It is a framework for managing devices on the Internet using the TCP-IP protocol suite. It
supports a set of fundamental operations for monitoring and maintaining the Internet.

203
 SNMP has two components Manager and agent.
 The manager is a host that controls and monitors a set of agents such as routers.
 It is an application layer protocol in which a few manager stations can handle a set
of agents.
 The protocol designed at the application level can monitor the devices made by
different manufacturers and installed on different physical networks.
 It is used in a heterogeneous network made of different LANs and WANs connected
by routers or gateways.

Managers & Agents

 A manager is a host that runs the SNMP client program while the agent is a router
that runs the SNMP server program.
 Management of the internet is achieved through simple interaction between a
manager and agent.
 The agent is used to keep the information in a database while the manager is used
to access the values in the database. For example, a router can store the appropriate
variables such as a number of packets received and forwarded while the manager
can compare these variables to determine whether the router is congested or not.
 Agents can also contribute to the management process. A server program on the
agent checks the environment, if something goes wrong, the agent sends a warning
message to the manager.

Management with SNMP has three basic ideas:

 A manager checks the agent by requesting the information that reflects the behavior
of the agent.
 A manager also forces the agent to perform a certain function by resetting values in
the agent database.
 An agent also contributes to the management process by warning the manager
regarding an unusual condition.

Packet Tracer

Packet Tracer is virtual networking simulation software developed by Cisco, to learn and
understand various concepts in computer networks. Networking devices appear in packet tracer
as they look in reality and a student can interact with various networking devices, by
customizing the configurations, by turning them on and off etc. Packet Tracer is teaching and
learning software and a tool, easy to work with, thus after working with virtual environment, a
student gains lot of confidence, when it comes to working in real-time environment. We can
track the path of a packet, when it moves from source to destination, and also learn and

204
understand, how to troubleshoot a network, when a packet doesn’t reach the destination. Packet
Tracer can be used to learn concepts more clearly by creating different scenarios. Since
Networking is all about imagination and it’s difficult to track movement of packets in a real-
time environment, thus various networking concepts can be explained by creating a virtual
environment, showing the moment of packets, exactly as it would happen in real-time. Packet
tracer can be used to understand the working of various networking devices, their use, what
makes them different and their appropriate use in a designing a network. Packet tracer is a user
friendly tool, with various options, where a user can customize and design a network. Various
tests can be run, to understand various network failures and how to troubleshoot them in real-
time.

Features of packet tracer

 Unlimited devices
 E-learning
 Customize single/multi user activities
 Interactive Environment
 Visualizing Networks
 Real-time mode and Simulation mode
 Self-paced
 Supports majority of networking protocols
 International language support
 Cross platform compatibility

Wireshark
Wireshark is a network packet analyser. A network packet analyser presents captured packet
data in as much detail as possible. We could think of a network packet analyser as a
measuring device for examining what’s happening inside a network cable, just like an
electrician uses a voltmeter for examining what’s happening inside an electric cable.

Purpose of Wireshark
 Network administrators use it to troubleshoot network problems.
 Network security engineers use it to examine security problems.
 QA engineers use it to verify network applications.
 Developers use it to debug protocol implementations
 People use it to learn network protocol internals.

Features of Wireshark
 It is multi-platform software, i.e., it can run on Linux, Windows, OS X, FreeBSD,
NetBSD, etc.
 It is a standard three-pane packet browser.
 It performs deep inspection of the hundreds of protocols.
 It often involves live analysis, i.e., from the different types of the network like the
Ethernet, loopback, etc., we can read live data.
 It has sort and filter options which makes ease to the user to view the data.

205
 It is also useful in VoIP analysis.
 It can also capture raw USB traffic.
 Various settings, like timers and filters, can be used to filter the output.
 It can only capture packet on the PCAP (an application programming interface used
to capture the network) supported networks.
 Wireshark supports a variety of well-documented capture file formats such as the
PcapNg and Libpcap. These formats are used for storing the captured data.
 It is the no.1 piece of software for its purpose. It has countless applications ranging
from the tracing down, unauthorized traffic, firewall settings, etc.

206
Unit-7
Network Security
Network Security Model
A Network Security Model exhibits how the security service has been designed over the
network to prevent the opponent from causing a threat to the confidentiality or authenticity of
the information that is being transmitted through the network.
For a message to be sent or receive there must be a sender and a receiver. Both the sender and
receiver must also be mutually agreeing to the sharing of the message. Now, the transmission
of a message from sender to receiver needs a medium i.e. Information channel which is
an Internet service.

A logical route is defined through the network (Internet), from sender to the receiver and using
the communication protocols both the sender and the receiver established communication.

Well, we are concerned about the security of the message over the network when the message
has some confidential or authentic information which has a threat from an opponent present at
the information channel. Any security service would have the three components discussed
below:

1. Transformation of the information which has to be sent to the receiver. So, that any
opponent present at the information channel is unable to read the message. This
indicates the encryption of the message.

It also includes the addition of code during the transformation of the information which
will be used in verifying the identity of the authentic receiver.

2. Sharing of the secret information between sender and receiver of which the opponent
must not any clue. Yes, we are talking of the encryption key which is used during the
encryption of the message at the sender’s end and also during the decryption of message
at receiver’s end.

3. There must be a trusted third party which should take the responsibility
of distributing the secret information (key) to both the communicating parties and
also prevent it from any opponent.

207
The network security model presents the two communicating parties sender and receiver who
mutually agrees to exchange the information. The sender has information to share with the
receiver.

But sender cannot send the message on the information cannel in the readable form as it will
have a threat of being attacked by the opponent. So, before sending the message through the
information channel, it should be transformed into an unreadable format.

Secret information is used while transforming the message which will also be required when
the message will be retransformed at the recipient side. That’s why a trusted third party is
required which would take the responsibility of distributing this secret information to both the
parties involved in communication.

So, considering this general model of network security, one must consider the following four
tasks while designing the security model.

1. To transform a readable message at the sender side into an unreadable format, an


appropriate algorithm should be designed such that it should be difficult for an opponent
to crack that security algorithm.

2. Next, the network security model designer is concerned about the generation of the
secret information which is known as a key. This secret information is used in
conjunction with the security algorithm in order to transform the message.

3. Now, the secret information is required at both the ends, sender’s end and receiver’s
end. At sender’s end, it is used to encrypt or transform the message into unreadable
form and at the receiver’s end, it is used to decrypt or retransform the message into
readable form. So, there must be a trusted third party which will distribute the secret
information to both sender and receiver. While designing the network security model
designer must also concentrate on developing the methods to distribute the key to the
sender and receiver. An appropriate methodology must be used to deliver the secret
information to the communicating parties without the interference of the opponent.

208
Cryptography
Cryptography is technique of securing information and communications through use of codes
so that only those person for whom the information is intended can understand it and process
it. Thus preventing unauthorized access to information. The prefix “crypt” means “hidden”
and suffix graphy means “writing”.
Basic principles of cryptography
1. Confidentiality:
The degree of confidentiality determines the secrecy of the information. The
principle specifies that only the sender and receiver will be able to access the
information shared between them. Confidentiality compromises if an unauthorized
person is able to access a message.
For example, let us consider sender A wants to share some confidential information
with receiver B and the information gets intercepted by the attacker C. Now the
confidential information is in the hands of an intruder C.

2. Authentication:
Authentication is the mechanism to identify the user or system or the entity. It
ensures the identity of the person trying to access the information. The
authentication is mostly secured by using username and password. The authorized
person whose identity is preregistered can prove his/her identity and can access the
sensitive information.

3. Integrity:
Integrity gives the assurance that the information received is exact and accurate. If
the content of the message is changed after the sender sends it but before reaching
the intended receiver, then it is said that the integrity of the message is lost.

4. Non-Repudiation:
Non-repudiation is a mechanism that prevents the denial of the message content sent
through a network. In some cases the sender sends the message and later denies it.
But the non-repudiation does not allow the sender to refuse the receiver.

5. Access control:
The principle of access control is determined by role management and rule
management. Role management determines who should access the data while rule
management determines up to what extent one can access the data. The information
displayed is dependent on the person who is accessing it.

6. Availability:
The principle of availability states that the resources will be available to authorize
party at all times. Information will not be useful if it is not available to be accessed.
Systems should have sufficient availability of information to satisfy the user
request.

Cryptography includes two major processes: Encryption & Decryption


 Encryption is the conversion of plain text i.e. the original message, into
another form, called cipher text, which cannot be easily understood by anyone

209
except authorized parties. It requires the original message, encryption key and
the encryption algorithm.
 Decryption is the reverse process to encryption i.e. it is the conversion of the
cipher text back to plain text. It requires the cipher text, decryption key and
the decryption algorithm.

Types of Cryptography:
1. Symmetric Key Cryptography (Secret Key Cryptography)

Symmetric key algorithms are algorithms for cryptography that use the same
cryptographic keys for both encryption and decryption. The keys, in practice, represent a
shared secret between two or more parties that can be used to maintain a private

210
information link. The most popular symmetric-key system is the Data Encryption
Standard (DES).
Encrypting and decrypting symmetric key data is relatively faster and easy, as same key
is used for both processes. However, the drawback is that the two parties must somehow
exchange the key in a secure way. Each two device in the network share a separate secret
key. For a fully connected network with ‘n’ number of nodes, the total number of keys
required = n(n-1)/2 and each node should have (n-1) keys, which is large in number.
Data Encryption Standard (DES):
It is a symmetric-key block cipher published by the National Institute of Standards and
Technology (NIST). DES is an implementation of a Feistel Cipher. It uses 16 round
Feistel structure. The block size is 64-bit. Though, key length is 64-bit, DES has an
effective key length of 56 bits, since 8 of the 64 bits of the key are not used by the
encryption algorithm (function as check bits only).

211
Key schedule:
The Figure illustrates the key schedule for
encryption the algorithm which generates the
subkeys. Initially, 56 bits of the key are selected
from the initial 64 by Permuted Choice 1 (PC-1) the
remaining eight bits are either discarded or used as
parity check bits. The 56 bits are then divided into
two 28-bit halves; each half is thereafter treated
separately.
In successive rounds, both halves are rotated left by
one or two bits (specified for each round), and then
48 subkey bits are selected by Permuted Choice 2
(PC-2) 24 bits from the left half, and 24 from the
right. The rotations (denoted by "<<<" in the
diagram) mean that a different set of bits is used in
each subkey; each bit is used in approximately 14
out of the 16 subkeys.
The key schedule for decryption is similar the subkeys are in reverse order compared to
encryption. Apart from that change, the process is the same as for encryption. The same
28 bits are passed to all rotation boxes.

2. Asymmetric Key Cryptography (Public Key Cryptography)

212
Public key cryptography is any cryptographic system that uses pairs of keys; public
keys which may be disseminated widely, and private keys which are known only to the
owner, i.e. public key of a device is known to all other devices in the network whereas
private key is kept private only with that device. Encryption is done using the recipient's
public key whereas decryption is possibly only with the recipient’s private key.
For this to work, it is required to generate a public and private key-pair to be used for
encryption and decryption. Public key algorithms, unlike symmetric key algorithms, do
not require a secure channel for the initial exchange of one (or more) secret keys between
the parties.
Because of the computational complexity of asymmetric encryption, it is usually used
only for small blocks of data. Compared to symmetric key system, it requires less number
of keys; 2 keys with each devices and thus total of 2n keys for ‘n’ number of devices in
the network. One of the example of Public key algorithm is RSA method.
RSA:
RSA is one of the first practical public-key cryptosystems and is widely used for secure
data transmission. RSA is made of the initial letters of the surnames of Ron Rivest, Adi
Shamir, and Leonard Adleman, who first publicly described the algorithm in 1977. The
RSA algorithm involves four steps: key generation, key distribution, encryption and
decryption.
Two large prime numbers, p and q, are generated using the Rabin-Miller primality test
algorithm. A modulus n is calculated by multiplying p and q, which is used by both the
public and private keys and provides the link between them. The public key consists of
the modulus n, and a public exponent, e. The e figure doesn’t have to be a secretly selected
prime number as the public key is shared with everyone.
The private key consists of the modulus n and the private exponent d, which is calculated
using the Extended Euclidean algorithm.
Then for encryption, is the cipher text
 C = Pe mod n
 where (n, e) are public key pair, and
 p text and C is the cipher text.
For Decryption, is the plain text
 P = Cd mod n
 where (n, d) are private key pair.
RSA Algorithm
1. Choose two different large random number.
2. Calculate n=p*q
3. Calculate Φ(n)= (p-1)(q-1)

213
4. Choose e such that 1<e< Φ(n)
e is co-prime to Φ(n), gcd (e, Φ(n))=1 [ e is public key]
5. Calculate d(private key), such that d congruent to 1 mod Φ(n)
[d=1+k Φ(n)] where k=0,1,2,3,….
Example
In a RSA cryptosystem a particular A uses two prime numbers p=13 and q=17 to generate
his public and private keys. If the public key of A is 35. Then find the private key.
Solution
Here, p=13, q=17
n=pxq=13*17=221
Φ(n)=(p-1)(q-1)=(12)(16)=192
Choose e such that 1<e< Φ(n)
1<35< 192
de=1+k Φ(n) where k=0,1,2,3,….
d=(1+k 192)/e
put k=0 we get d=(1+0*192)/35=1/35 =0.02 which is not possible
put k=1 we get d=(1+1*192)/35=193/35 =5.5 which is not possible
put k=2 we get d=(1+2*192)/35=385/35=11
so the private key is 11
3. Hash function
Hash Functions: No key is used in this algorithm. A fixed-length hash value is
computed as per the plain text that makes it impossible for the contents of the plain text
to be recovered. Hash functions are also used by many operating systems to encrypt
passwords.

Digital Signature Algorithm

Digital signature is a cryptographic value that is calculated from the data and a secret key
known only by the signer or the person whose signature is that.

In fact, in the real world, the receiver of message needs assurance that the message belongs to
the sender and he should not be able to hack the origination of that message for misuse or
anything. Their requirement is very crucial in business applications or any other things since
the likelihood of a dispute over exchanged data is very high to secure that data.

214
Fig: Block diagram of Digital Signature

 Firstly, each person adopting this scheme has a public-private key pair in
cryptography.
 The key pairs used for encryption or decryption and signing or verifying are different
for every signature. Here, the private key used for signing is referred to as the
signature key and the public key as the verification key in this algorithm.
 Then, people take the signer feeds data to the hash function and generates a hash of
data of that message.
 Now, the Hash value and signature key are then fed to the signature algorithm which
produces the digital signature on a given hash of that message. This signature is
appended to the data and then both are sent to the verifier to secure that message.
 Then, the verifier feeds the digital signature and the verification key into the
verification algorithm in this DSA. Thus, the verification algorithm gives some value
as output as a ciphertext.
 Thus, the verifier also runs the same hash function on received data to generate hash
value in this algorithm.
 Now, for verification, the signature, this hash value, and output of verification
algorithm are compared with each variable. Based on the comparison result, the
verifier decides whether the digital signature is valid for this or invalid.
 Therefore, the digital signature is generated by the 'private' key of the signer and no
one else can have this key to secure the data, the signer cannot repudiate signing the
data in the future to secure that data by the cryptography.

Communication Security and Web Security:


The major concern in a network is the security, that is, how to get the bits secretly and without
modification from source to destination and how to keep unwanted bits away from the
original data. Communication security can be achieved through various methods as:
1. IPSec:
Internet Protocol Security (IPsec) is a protocol suite for securing Internet Protocol (IP)
communications by authenticating and encrypting each IP packet of a communication
session, which operate in Internet Layer. IPsec includes protocols for establishing mutual
215
authentication between agents at the beginning of the session and negotiation of
cryptographic keys to be used during the session.
IPsec supports network-level peer authentication, data origin authentication, data
integrity, data confidentiality (encryption). IPsec suite is an open standard which uses for
following protocols to perform various functions:
Authentication Headers (AH) provide connectionless integrity and data origin
authentication for IP datagrams and provides protection against replay attacks. A replay
attack (also known as playback attack) is a form of network attack in which a valid data
transmission is maliciously or fraudulently repeated or delayed.
Encapsulating Security Payloads (ESP) provide confidentiality, data-origin
authentication, connectionless integrity, an anti-replay service (a form of partial sequence
integrity), and limited traffic-flow confidentiality.
IPsec can operate in two different modes: transport mode and tunnel mode.
 In transport mode, only the payload of the IP packet is usually encrypted
and/or authenticated.
 In tunnel mode, the entire IP packet is encrypted and/or authenticated.
2. Firewall:
Firewall is software or hardware-based network security system that controls the
incoming and outgoing network traffic based on applied rule set. In contrast to IPsec
which protects data in transit between secure sites, a firewall establishes a barrier between
a trusted, secure internal network and another network (e.g., the Internet) that is not
assumed to be secure and trusted.
Firewall can act as Packet Filter Firewall. The packet filter firewall inspects each and
every incoming and outgoing packet. Packets meeting some criterion described in rules
formulated by the network administrator are forwarded normally and those that fail the
test are dropped.

In the figure, the following packets are filtered.

216
1. Incoming packets from network [Link] are blocked. Here, ‘*’ means “any”.
2. Incoming packets destined for any internal TELNET server (port 23) are blocked.
3. Incoming packets destined for internal host [Link] are blocked. The
organization wants this host for internal use only.
4. Outgoing packets destined for an HTTP server (port 80) are blocked. The organization
does not want employees to browse the internet.
The other kind of firewall is the Stateful firewall which maps packets to connections and
use TCP/IP header fields to keep track of connections. This allows for rules that, for
example, allow an external Web server to send packets to an internal host, but only if the
internal host first establishes a connection with the external Web server. (Such a rule is
not possible with stateless designs that must either pass or drop all packets from the
external Web server).
The other level of sophistication up from stateful processing is for the firewall to
implement application-level gateways. This processing involves the firewall looking
inside packets, beyond even the TCP header, to see what the application is doing.
3. Virtual Private Networks:
Since using leased dedicated lines to set up private network result into excessive cost, it
would be better to have options to use the public network, but, with much increased
security just as the private network. VPN allows privacy across the public network.
4. Wireless Security:
Wireless security is in essence, the prevention of unwanted users from accessing a
particular wireless network. More so, wireless security, also known as Wi-Fi security, aims
to ensure that your data remains only accessible to users you authorize.
Wireless Security Protocols such as Wired Equivalent Privacy (WEP) and Wi-Fi Protected
Access (WPA) is the authentication security protocols created by the Wireless Alliance
used to ensure wireless security. There are four wireless security protocols currently
available.

 Wired Equivalent Privacy (WEP)


 Wi-Fi Protected Access (WPA)
 Wi-Fi Protected Access 2 (WPA 2)
 Wi-Fi Protected Access 3 (WPA 3)

Wired Equivalent Privacy (WEP)


Wired Equivalent Privacy (WEP) is the first security protocol ever put in practice. Designed in
1997, it has become obsolete but is still used in modern times with older devices.

WEP uses a data encryption scheme that is based on a combination of user- and system-
generated key values. However, it is widely known that WEP is the least secure network type
as hackers have developed tactics of reverse-engineering and cracking the encryption system.

217
Wi-Fi Protected Access (WPA)
Wi-Fi Protected Access (WPA) was developed to deal with the flaws that were found with the
WEP protocol. WPA offers features such as the Temporal Key Integrity Protocol (TKIP) which
was a dynamic 128-bit key that was harder to break into than WEP’s static, unchanging key.

It also introduced the Message Integrity Check, which scanned for any altered packets sent by
hackers, the Temporal Key Integrity Protocol (TKIP), and the pre-shared key (PSK), among
others, for encryption.

Wi-Fi Protected Access 2 (WPA 2)


In 2004, WPA2 brought significant changes and more features to the wireless security gambit.
WPA2 replaced TKIP with the Counter Mode Cipher Block Chaining Message Authentication
Code Protocol (CCMP) which is a far superior encryption tool.

WPA2 has been the industry standard since its inception, on March 13, 2006, the Wi-Fi
Alliance stated that all future devices with the Wi-Fi trademark had to use WPA2.

Wi-Fi Protected Access 3 (WPA 3)


WP3 is introducing the first major changes to wireless security in 14 years. Some notable
additions for the security protocol are: Greater protection for passwords
Individualized encryption for personal and open networks More security for enterprise
networks.

218
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2020

Bachelor in Computer Applications Full Marks: 60


Course Title: Computer Networking (CACS 303) Pass Marks: 24
Code No: CACS 303 Time : 3 hours
Semester: V

Candidates are required to answer the questions in their own words as far as possible.

Group B
Attempt any SIX questions. [6×5=30]
2. Define protocols. Explain WWW and HTTP protocol. [1+1+2]
3. Define transmission impairment. Explain the causes of impairments. [1+4]
4. Define HDLC. Explain the HDLC frame formats. [1+4]
5. Define IP Address. Specify IPV4 address classes with their address ranges. [1+4]
6. Define Subnetting. Suppose you are given network address: [Link] and [1+2+2]
subnet mask: [Link] then calculate total number of subnets and total
number of hosts per subnet.
7. Draw a User Datagram format. Explain UDP operation. [2+3]
8. Write short note on (Any Two): [2.5+2.5]
a) DNS b) Public Key Cryptography c) VPN

Group C
Attempt any TWO questions. [2×10= 20]

9. Critically analyze the OSI reference mode. [10]


10. Explain the random-access protocols under the multiple access taxonomy. [10]
11. Explain the IPV4 Header format in detail. [10]
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2021
Bachelor in Computer Applications Full marks: 60
Course Title: Computer Networking Pass Marks: 24
Code No: CACS 303 Time: 3 hours
Semester: V
Symbol No: Center:
Candidates are required to answer the questions in their own words as far as possible.
Group A
Attempt all the questions. [10×1=10]
1. Circle ( ) the correct answer in the following questions.
i. Switch is ………….. layer device.
a) Datalink b) Physical c) Network d) Transport
ii. In ………….. system, resources are allocated on demand.
a) Packet switching b) Circuit switching
c) Line switching d) Message switching
iii. Automatic repeat request error management mechanism is provided by …………
a) Logical link control sublayer b) Media access control sublayer
c) Network interface control sublayer d) Application access control sublayer
iv. The size of an IP address in IPV6 is …………
a) 4 bytes b) 128 bits c) 8 bytes d) 100 bytes
v. Which of the following task is not a function of network layer?
a) Routing b) Inter-networking
c) Congestion control d) Error control
vi. Which of the following is false with respect to UDP?
a) Connection-oriented b) Unreliable
c) Transport layer protocol d) Low overhead
vii. Which one of the following protocol delivers/stores mail to receiver server?
a) Simple mail Transfer Protocol b) Post office protocol
c) Internet mail access protocol d) Hyper Text Transfer protocol
viii. Message authentication is the service beyond …………
a) Message confidentiality b) Message integrity
c) Message splashing d) Message sending
ix. Message ……………….. means that the data must arrive at the receiver exactly as sent.
a) Confidentiality b) Integrity
c) Authentication d) None of the above
x. Which type of topology is best suited for large business which must carefully control and
coordinate the operation of distributed branch outlets?
a) Bus b) Ring c) Star d) Mesh
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2021

Bachelor in Computer Applications Full Marks: 60


Course Title: Computer Networking (CACS 303) Pass Marks: 24
Code No: CACS 303 Time : 3 hours
Semester: V
Candidates are required to answer the questions in their own words as far as possible.
Group B
Attempt any SIX questions. [6×5=30]
2. Explain TCP/IP Reference model. [5]
3. “Sloted ALOHA improves the performance of system over pure ALOHA”. [5]
Justify.
4. Differentiate between Reliable and Unreliable connection with their [5]
application.
5. What is DNS? How it works? [1+4]
6. What is cryptography? Explain the principle of cryptography [1+4]
7. What is TCP? Describe TCP segment header. [1+4]
8. Write short note on (Any Two): [2.5+2.5]
a) Fragmentation b) Channelization c) VPN

Group C
Attempt any TWO questions. [2×10= 20]

9. Classify and calculate the total number of Networks and Hosts per network in [10]
IPV4.
10. Explain the IPV4 Header format in detail. [10]
11. What is switching? Describe the types of switching with their advantages and [1+9]
disadvantages.
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2022
Bachelor in Computer Applications Full marks: 60
Course Title: Computer Networking Pass Marks: 24
Code No: CACS 303 Time: 3 hours
Semester: V
Symbol No: Center:
Candidates are required to answer the questions in their own words as far as possible.
Group A
Attempt all the questions. [10×1=10]
1. Circle ( ) the correct answer in the following questions.
i. The layer responsible for process delivery is …………
a) Application b) Network c) Datalink d) Transport
ii. What layer in the TCP/IP stack is equivalent to the Transport layer of the OSI model?
a) Application b) Network Access
c) Host-to-Host d) Internet
iii. Wireless transmission cannot be done through ………..waves.
a) Radio b) Micro c) Intra d) Ultrasonic
iv. ………. occurs when 2 or more bits in a data unit has been changed during the transmission.
a) Burst error b) Random error c) Double error d) Unrecoverable
error
v. What is the size of MAC address?
a) 32 bit b) 64 bit c) 48 bit d) 128 bit
vi. ICMP is primarily used for ………..
a) error and diagnostic functions b) addressing
c) forwarding d) routing
vii. Which of the following is false with respect to UDP?
a) Transport layer protocol b) Connection-oriented
c) Unreliable d) Low overhead
viii. Which address identifies a process on a host?
a) Physical b) Logical c) Port d) Specific
ix. Which is a valid IP private address?
a) [Link] b) [Link]
c) [Link] d) [Link]
x. What command do you type to save the configuration stored in RAM to NVRAM in cisco
router?
a) Router(config) #copy current to starting b) Router#copy run startup
c) Router#copy starting to running d) Router(config) #copy running-config
startup-config
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2022

Bachelor in Computer Applications Full Marks: 60


Course Title: Computer Networking (CACS 303) Pass Marks: 24
Code No: CACS 303 Time : 3 hours
Semester: V
Candidates are required to answer the questions in their own words as far as possible.
Group B
Attempt any SIX questions. [6×5=30]
2. What is digital signature and how it works? [5]
3. Why do we need DNS when we can directly use an IP address? Explain the [2+3]
process to resolve the domain [Link]?
4. What do you mean by IP datagram fragmentation? [5]
5. Explain the mechanism of bit and byte stuffing with suitable example. [5]
6. Explain the causes of transmission impairment in data communication. [5]
7. What is flow control? Explain Go-Back-N ARQ with suitable diagram [1+4]
8. Explain in detail about the structure of IPV6 address. Differentiate between [3+2]
IPV4 and IPV6 address.

Group C
Attempt any TWO questions. [2×10= 20]

9. Explain how slotted Aloha improves the performance of system over pure [2+8]
Aloha. A bit stream of 100101010 is transmitted using CRC method. The
generator polynomial is x3 + 1. Show the actual bit string transmitted and if
fourth bit from LSB is altered, show the error detection in receiver side.
10. Why do we need layered protocol architecture? Discuss each layer of TCP/IP [2+4+4]
architecture along with function of each layer. Write the protocols used in each
layer of TCP/IP model.
11. Why do we need subnetting? What is the new subnet mask? Write subnet ID [2+1+7]
and broadcast address of each subnet if you divide a class C network
([Link]-[Link]) into different subnets?
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2024
Bachelor in Computer Applications Full marks: 60
Course Title: Computer Networking Pass Marks: 24
Code No: CACS 303 Time: 3 hours
Semester: V
Symbol No: Center:
Candidates are required to answer the questions in their own words as far as possible.
Group A
Attempt all the questions. [10×1=10]
1. Circle ( ) the correct answer in the following questions.
a) Which of the following layer is responsible for delivery from process to process?
a) Network layer b) Transport layer
c) Application layer d) Datalink layer
b) Which of the following is invalid MAC address?
a) dc2148859b0d b) dc:21:48:85:9b:0d
c) DC-21-48-85-9B-0C d) hc-21-48-85-9b-0d
c) Which of the following is maximum throughput of pure ALOHA network?
a) 18.4% b) 35.8% c) 36.8% d) 50%
d) Which of the following is a invalid private IP Address?
a) [Link] b) [Link] c) [Link] d) [Link]
e) Which class of IP address is used for multicasting?
a) Class A b) Class D c) Class E d) Class
f) How many Geostationary satellites are required to cover a whole earth?
a) 10 b) 3
c) 50 d) 300
g) What is the size of IPV6?
a) 4 bytes b) 6 bytes
c) 8 bytes d) 16 bytes
h) Which of the following protocol does not assures reliability in communication?
a) Simple Protocol b) Stop and Wait Protocol
c) Go-back-N Protocol d) Selected Repeat
i) Which of the following is not a type of firewall?
a) Stateful Inspection firewall b) Circuit-level gateway
c) Logical firewall d) Packet-filtering firewall
j) Which of the following is not asymmetric key algorithm?
a) DSA b) AES
c) RSA d) Diffic-Hellman
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2024

Bachelor in Computer Applications Full Marks: 60


Course Title: Computer Networking (CACS 303) Pass Marks: 24
Code No: CACS 303 Time : 3 hours
Semester: V
Candidates are required to answer the questions in their own words as far as possible.
Group B
Attempt any SIX questions. [6×5=30]
2. Explain the features of TCP/IP reference model. [5]
3. Define switching. Explain the types of switching. [1+4]
4. Explain the ALOHA with its performance. [5]
5. Define IP Address. Explain the classes of IPV4. [1+4]
6. Differentiate between the functions of TCP and UDP. [5]
7. Explain the role of DHCP, FTP and HTTP protocols. [2+1.5+1.5]
8. Write short notes on (any two): [2.5+2.5]
a) RSA
b) CRC
c) Firewall

Group C
Attempt any TWO questions. [2×10= 20]

9. Explain transmission media with their major characteristics. [10]


10. a) Differentiate between static and dynamic routing with suitable example. [5]
b) Define Subnetting. Calculate total number of subnets and hosts per subnet [1+4]
for Network Address [Link] and subnet mask is [Link]
11. Write the services provided by Transmission Control Protocol. Explain the [3+7]
TCP header segment in detail.

You might also like