Computer Networking (Complete Note)
Computer Networking (Complete Note)
1
A typical network infrastructure includes:
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).
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.
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.
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.
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.
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:
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.
4
2. Home Application
Some of the most important uses of the Internet for home users are as follows:
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.
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.
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.
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.
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.
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.
6. 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.
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
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.
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.
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.
Overloaded Servers: When there are frequent simultaneous client requests, server
severely get overloaded, forming traffic congestion.
15
3. There is no central point of data storage for file archiving.
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.
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.
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.
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.
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.
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.
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.
19
Difference between LAN, MAN and WAN
BASIS OF
LAN MAN WAN
COMPARISON
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.
Speed High speed (1000 moderate speed(44 to Less speed (150 Mbps)
Mbps) 150 Mbps)
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.
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.
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.
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.
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 :
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.
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.
• 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.
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.
27
• Session establishment, maintenance and termination: The layer allows the two
processes to establish, use and terminate a connection.
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.
• 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.
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.
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
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.
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.
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.
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.
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.
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.
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
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
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.
4. The analog signal bandwidth is low 4. The digital signal bandwidth is high.
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.
• 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
42
Figure: Distortion
Noise
Noise is unwanted energy from sources other than the transmitter. Noise can be categorized
into the following four types:
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
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
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
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)
=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)
45
Now, Capacity = Bandwidth * log2(1 + SNR)
= 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
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?
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.
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.
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.
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.
• 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
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.
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.
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.
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.
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.
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.
• Higher bandwidth
• Less signal attenuation
• Immunity to electromagnetic interference
54
• Resistance to corrosive materials
• Light weight
• Greater immunity to tapping
Applications are
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.
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.
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.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
69
There are two techniques to spread the bandwidth:
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.
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.
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.
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.
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.
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.
74
Advantages 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.
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
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.
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.
The technology choices are many and varied and can be divided into two main categories
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;
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.
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.
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:
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. •
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.
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.
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.
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
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.
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.
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.
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.
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 …
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.
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.
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)
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.
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.
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.
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.
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.
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.
104
There are several different standard polynomials used by popular protocols for CRC
generation. These are:
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.
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.
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).
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.
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.
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:
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
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
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.
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.
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.
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
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.
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:
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:
121
Ethernet (IEEE 802.3) Frame Format –
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 −
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
Scatternet
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
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
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.
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.
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.
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
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.
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.
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]
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]
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]
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]
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.
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.
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
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
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
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
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
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.
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
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
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.
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.
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.
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.
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.
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
3. Connection Control
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.
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.
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.
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
171
protocol, called Remote Procedure Call (RPC), that more closely matches the needs of an
application involved in a request/reply message exchange.
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.
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:
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.
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.
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.
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.
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.
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.
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.
182
Application layer protocols
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.
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
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
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.
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 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).
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
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.
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.
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:
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.
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).
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):
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
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.
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.
8. The speed of HTTP is fast as compared 8. The speed of HTTPS is slow as compared
to HTTPS. to HTTP.
10. Examples of HTTP websites are 10. Examples of HTTPS websites are
Educational Sites, Internet Forums, etc. shopping websites, banking websites, etc.
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.
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
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
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)
Objectives of FTP
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.
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.
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
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.
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.
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.
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
IMAP POP3
1. IMAP stands for Internet Message Access 1. It stands for Post Office Protocol3.
Protocol.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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 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.
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.
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.
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.
218
Tribhuvan University
Faculty of Humanities and Social Sciences
OFFICE OF THE DEAN
2020
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]
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
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
Group C
Attempt any TWO questions. [2×10= 20]