[go: up one dir, main page]

0% found this document useful (0 votes)
54 views141 pages

CN NOTES 1 To 5

Uploaded by

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

CN NOTES 1 To 5

Uploaded by

2103a51237
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 141

COMPUTER NETWORKS

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology).,
B.lit(Tamil).,M.A (Criminology).,(Ph.D)

Assistant Professor
Department of Computer Science and Engineering
School of CS & AI
SR University

Ananthasagar village, Hasanparthy Mandal, Hanmakonda District – 500 376


SYLLABUS

COMPUTER NETWORKS

UNIT I
Introduction –Network Architecture, Network Topologies, Network Design. Reference models- OSI Reference
Model, TCP/IP Reference Model. A Comparison of the OSI and TCP/IP Reference Models.

Physical Layer: Transmission media, Introduction to Encoding.

UNIT II
Data link Layer
Channelization, Multiplexing, Framing, Error Detection and Correction, Flow Control-Sliding Window Protocols,
Medium Access Control sub layer, Basic Structure of a Switch, Circuit Switching and Packet Switching, Ethernet,
Introduction to IEEE 802 standards.

UNIT III
Network Layer
Logical Addressing-IPv4 addressing, IPv6 Addressing. IPv4 and IPv6 Packet formats, Transmission from IPv4 to
IPv6 , Address mapping , ICMP,IGMP , Unicast Routing Algorithms ,Multicast Routing Algorithms .

UNIT IV
Transport Layer
Elements of transport layer, User Datagram Protocol(UDP),Transmission Control Protocol (TCP), Data Traffic ,
Congestion Control , Congestion Control in TCP and Frame Relay ,Quality of Services(QoS),Techniques to improve
the QoS ,Remote Procedure Call (RPC), Real-time Transport Protocol(RTP) .

UNIT V
Presentation Layer
Data Formatting, Data Compression-Audio and Video Compression. Network Security- cryptographic tools, the
problems of key distribution, General authentication techniques-IPSec, PGP, Firewalls.

Application Layer
Electronic Mail-Architecture, User Agent, DNS, SMTP, POP and IMAP. File Transfer Protocol.

TEXT BOOKS:
1. Andrew S. Tanenbaum, David J Wetherall, Computer Networks, 5th Edition, Pearson Edu, 2010.
2. Behrouz A. Forouzan, “Data communication and Networking”, Tata McGraw-Hill, 2004.
3. Larry L Peterson and Bruce S Davis, “Computer Networks”, 5th Edition, Elsevier, 2012.

REFERENCE BOOKS:
1. William Stallings, “Data and Computer Communications”, Eighth Edition, Pearson Education, 2011
2. Nader F. Mir, “Computer and Communication Networks”, First Edition, Pearson Education, 2007.
3. Ying-Dar Lin, Ren-Hung Hwang and Fred Baker, Computer Networks: An Open Source Approach “,
McGraw Hill Publisher, 2011.
4. James F. Kurose, Keith W. Ross, “Computer Networking, A Top-Down Approach Featuring the Internet”,
Sixth Edition, Pearson Education, 2013.

WEB LINKS:
http://nptel.ac.in/video.php?subjectId=106105081.
http://wps.pearsoned.com/ecs_kurose_compnetw_6/216/55463/14198500.cw/
Unit - 1 Computer Networks

UNIT I
Introduction –Network Architecture, Network Topologies, Network Design. Reference models-
OSI Reference Model, TCP/IP Reference Model. A Comparison of the OSI and TCP/IP Reference
Models.
Physical Layer: Transmission media, Introduction to Encoding.
Data Communication
➢ Data communication is the exchange of data between two devices through a
transmission media (wired or wireless)
➢ Data is exchanged in the form of 0’s and 1’s.
Components of Data Communication:
1. Message :- Information or data to be communicated (ex:- text,number,picture and video)
2. Sender :- Device that sends the message (ex:- computer,laptop,mobile)
3. Receiver:- Device that receive the messge(ex:- printer,computer,headset)
4. Medium:- Path through which the message travels from sender to receiver (ex:- Twisted
pair cable, radio waves etc.,)
5. Protocol:- Set of rules that governs data communication.

Data Communication

Types of Data Communication (Transmission modes)


➢ The way in which data is transmitted from one device to another device is known as
transmission mode.

Simplex mode
➢ Data is transmitted in one direction only(unidirectional)
➢ One device sends the data and other devices the data.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Example
✓ keyboard or mouse inputs to the computer
✓ Computer to Printer
✓ Scanner to Computer
✓ Speaker output from the computer
Half duplex mode
➢ Data can be transmitted in both directions but not at the same time.

Example
✓ Walkie-Talkie : you can talk from both device but at one time only one person can talk
and others can only listen

Full duplex mode


➢ Data can be transmitted in both directions simultaneously.

Example
✓ Mobile phone network where two persons can communicate simultaneously means both sides
person can talk and listen at the same time.
********
Network
➢ A network is the interconnection , of set of devices that are capable of communication devices
(host). Ex- Laptop, computer,mobile,printer etc.,
o Communication devices => Host
o Transmission media => Link (wire/wireless)
➢ All Networks must have :-
o A resources to share
o A pathway to transfer data(Transmission media)
o A set of rules governing how to communicate(protocols)
Networking Criteria
1. Performance
➢ Transit Time :- Time taken by a message to travel from one device to other.
➢ Response Time:- Time elapsed between inquiry and response.
➢ Performance of a network depends on
o Number of users
o Type of transmission medium
o Capacity of connected hardware
o Efficiency of software

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

2. Reliability
o Accuracy in delivery
o Measured by network failures
3. Security
Protecting data from unauthorized access and viruses.

Network (Connecting all devices)


Computer Network
➢ A Computer Network is defined as a set of two or more computers that are linked together,
either via wired cables or wireless networks (i.e.) WiFi.,
➢ Purpose of computer network is communicating, exchanging, sharing or distributing data,
files and resources.
➢ Computer Networks are built using a collection of hardware (such as routers, switches, hubs
etc.,) and networking software (such as operating systems, firewalls, or corporate applications).

Computer Network
Advantage of Computer Network:-
➢ Increase speed
➢ Ease of accessibility
➢ Resource sharing
➢ Greater storage capacity

Disadvantage of Computer Network:-


➢ Spread of computer virus
➢ Implementation issues (high cost of installation)
➢ Failure of server
➢ Cable faults

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Application of Networks or Use of Network


1. Business Applications
✓ Marking and sales (Ex:- Online reservation of hotels or room)
✓ Financial Services (Ex:- Online Banking)
✓ Manufacturing (Ex:- CAD)
✓ Tele conferencing (Ex:- Voice/video conferencing)
✓ Electronic Messaging (Ex:- E-mail)
2. Home Application
✓ Cellular Telephone (Ex:- Person to Person Communication)
✓ Access to remote information- Cable Television (Ex:- Video on Request)
3. Social Network
✓ Inter Connected People - To connect friends (Ex:- Facebook , instagram,Whatsapp)
✓ Sharing Experiences and Knowledge (Ex:- Linked –In)
***********
Network devices (or) Network Components
➢ Hardware devices that are used to connect computers, printers and other electronic devices to a
network are called network devices.
➢ These devices transfer data in a fast, secure and correct way over same or different networks.
➢ Network devices may be inter-network (Global) or intra-network(with in the organization).

1) RJ 45
➢ Registered Jack-45
➢ An 8 pin / 8 – position plug or jack commonly used to connect computers onto Internet

2) Hub
➢ Hub is a network device that is used to connect multiple computers in a network.
➢ All the information send to the hub is automatically send to each port to every device.
➢ A hub is less expensive, less intelligence and less complicated.
➢ Hub generally used to connect computers in a LAN.
➢ Input data that arrives on port1 will be transmitted on all ports 2 to 8.
Example :- Home, Small organization

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Advantages Disadvantages
o Hub can broadcast the message o If the Hub is failed the entire network will
o Less expensive be failed
o Easy installation o Hub doesn’t provide any security
o Robust

3.Switch
➢ Switch is a network device that connects multiple computers together in the network.
➢ Switch can easily identifies that which device is connected with which port by using MAC
address, so that it delivered message on particular destination machine.
Example:- College or University Lab setup , Large organization

Advantages Disadvantages
o Unicast the message o If switch is failed then entire network will
o More security be failed.
o Send the data packet based on MAC address o More expensive
o If a node (computer) fails, there will be no o Difficult to setup
effect in the entire network.
4.Router
➢ Router receives the data packet from the sender, analyse and forward those data packets to
the receiver.
➢ It works as a traffic controller.
➢ It helps to connect two different computer networks
➢ A main work of router is to choose a congestion free path through which data packet will travel.
Advantages Disadvantages
o It provides connection between two o Expensive
dissimilar types of network. o Complex to maintain
o Transmission rate is very high. o Security issues
o Internally use some algorithm to find out
congestion free path.
o It provides both wire and wireless facility.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

5.Repeater
➢ Repeater is a network device through which we can “Boost up the weak signal”.
➢ When the signal travels in the network, after travelling some distance intensity of the signal
become low.
➢ In order to regenerate the weak signal we should use repeater device.

Advantages Disadvantages
o Regenerated weak signal o It required number of repeater after some
o Repeater has the ability to extend the length distances
of the signal o They can’t reduce network traffic
o Increase/maintain the signal performance

6.Bridge
➢ Bridge, known as Network Bridge, is a network interconnection device used to connect two or
more local area networks.
➢ It is responsible for network bridging, which receives and amplifies signals from a network cable,
and then sends them to the next cable.
➢ The main function of this is to examine the incoming traffic and examine whether to filter it or
forward it

Advantages Disadvantages
o We can extend the network using bridge o Once it broadcast the message then it is
o Collision can be reduced easily incapable to stop the message
o It is more intelligent o More expensive

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

7.Gateway
➢ A gateway is a key access point that acts as a “gate” between an organisation’s network and the
outside world of the internet.
➢ Gateway serves as the entry and exit point of a network, as all data incoming in or going out of a
network.
➢ Gateway is usually the Internet Service Provider that provider that provides access to the entire
internet.

8.NIC card or Network Interface Card


➢ It is a hardware device without which we can’t connect computer to the internet.
Internal NIC External NIC
o In this card, the motherboard has a slot for o In laptop (new model) that doesn’t have an
the network card where it can be inserted. internal NIC, external NIC are used
o It requires a network cable (RJ 45) to (Wireless or USB cable).
provide internet access.

9.Modem
➢ It is a hardware device.
➢ It helps to convert signals from one computer network to another.
➢ It works as signal translator because it translates one signal to another signal.
➢ It also called Modulator–Demodulator.
➢ MO + DEM = Modulator Demodulator

➢ A computer only read digital signals, while on the internet analog signal are used.
Modulators
o It converts digital signals into analog signal so data can be sent on internet.
Demodulators
o It converts incoming analog signals from the internet into digital signal, so that a
computer can understand
************

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Network Architecture
➢ The architecture defines how computers must communicate with each other to obtain
maximum benefits from a computer network, such as better response time, security, scalability,
transfer data rate, connectivity, etc.,

1.Peer to Peer (P2P)


➢ Peer to peer is a network in which all the computer systems with are connected to each
other with equal privilege.
➢ Files can be shared directly between systems on the network without the need of a central
server.
➢ Peer-To-Peer network is useful for small environments, usually up to 10 computers.

Example
✓ Small office
✓ Within a single department of a larger organization

Advantages
✓ Less Costly: There are no dedicated servers.
✓ It is simple to set up and maintain.
✓ A network administrator is not required.

Disadvantages
✓ It usually doesn't work well with more than "10" users.
✓ It has a security flaw because the computers are self-
managed.

Peer to Peer (P2P)


2.Client-Server Architecture
➢ The client sends a request, and the server returns a response.
➢ This exchange of messages is an example of inter-process communication or client-server
communication.
➢ In simple terms, the server can be defined as a provider of services, and the client can be a
requester to services.
Advantages
➢ Centralized server: Back up easy
➢ Scalability: We can add an new system and entire system is mainteined by the server.
➢ Performance: server increases the speed of sharing resources.
➢ Security: These networks are more secure as all the shared resources are centrally administered.
Disadvantages
➢ In case of server failure entire network will be failed.
➢ Server maintainance cost is high.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

***************
Network Topology
The way to arrange or connect patterns of computers/nodes/devices used in the network is
known as network topology.

1. Bus Topology
➢ Bus topology is a type of network in which each computer and network device is joined to
single cable.
➢ When it consists of exactly two endpoints, then it is called Linear Bus topology.

Advantages Disadvantages
➢ Less expensive o Cables fails then whole network fails.
➢ Less cabling o If network traffic is heavy.
➢ Used in small networks. o Cable has a limited length.
➢ It is easy to understand.
➢ Easy to expand joining two cables
together.

2. Ring Topology
➢ It forms a ring as each computer is connected to another computer, with the last one
connected to the first.
➢ Exactly two neighbours for each device.
➢ Data flow in clock wise direction (uni direction)
➢ Number of links is N

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Advantages
o Easy to install and reconfigure.
o Adding or deleting a device in-ring topology needs you
to move only two connections.
o Offers equal access to all the computers of the
networks
Disadvantages
o Unidirectional traffic.
o Failure of one computer can disturb the whole
network.
o The troubleshooting process is difficult in a ring
topology.

3. Star Topology
➢ In the star topology, all the
computers connect with the help of
a hub.
➢ ‘n’ devices are connected to ‘n’
links (Ex:- 4 devices are connected
using 4 links)
➢ All links are connected to central
node(HUB).

Advantages
o Fast performance and low network traffic.
o Hub can be upgraded easily.
o Easy to troubleshoot.
o Easy to setup and modify.
o Only that node is affected which has failed, rest of the nodes can work smoothly.
Disadvantages
o Cost of installation is high.
o If the hub fails then the whole network is stopped because all the nodes depend on the
hub.

4.Mesh Topology
➢ The mesh topology has a unique network design in which each computer on the network
connects to every other.
Types
Full Mesh Topology Partial Mesh Topology
➢ In this topology, every nodes or device ➢ In this type of topology, most of the devices
are directly connected with each other. are connected almost similarly as full
➢ Number of links is N*(N-1) / 2 topology.
➢ The only difference is that few devices are
connected with just two or three devices.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Advantages Disadvantages
o Eliminates traffic problem o Installation and reconfiguration
o Robust o More space
o Privacy and Security o Expensive (Cabling cost is more)
o Easy fault identification and fault detection

5.TREE Topology
➢ It has a root node and all other nodes
are connected to it forming a
hierarchy. It is also called hierarchical
topology.
➢ It should at least have three levels to the
hierarchy.
Advantages:
o Failure of one node never affects the rest
of the network.
o Detection of error is an easy process
o It is easy to manage and maintain
Disadvantages:
o It is heavily cabled topology
o If more nodes are added, then its
maintenance is difficult
o If the hub or concentrator fails, attached
nodes are also disabled.

6.Hybrid Topology
➢ Hybrid topology combines two or more topologies.
➢ For example if in an office in one department ring topology is used and in another star topology is
used, connecting these topologies will result in Hybrid Topology (ring topology and star
topology).
Advantages
➢ Error detecting and trouble shooting is
easy.
➢ Effective.
➢ Scalable as size can be increased
easily.
➢ Flexible.
Disadvantages
➢ Complex in design.
➢ Costly.

***************
Network Design (or) Types of Networks (or) Categories of Network
➢ Scale wise the Computer network can be categorized.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

1.PAN (Personal Area Network)


➢ It is the smallest network of computers.
➢ It has a 10-metre range of connectivity.
➢ It can cover up to 30 feet in diameter.
➢ PAN network enables a single person's personal devices to connect with each other.

Advantages
o Relatively secure and safe
o Strictly to a small area (up to ten
meters)
o Less cost

Disadvantages
o Distance limits
o Unable to extend

2.LAN (Local Area Network)


➢ A Local Area Network (LAN) is a group of computer and peripheral devices which are connected
in a limited area such as school, laboratory, home, and office building.
➢ LAN network is low cost.
➢ 10m to 1km range
➢ Example:- College or University
Advantages
o It can easily transfer data and
messages over networked
computers.
o It offers the facility to share a single
internet connection among all the
LAN users.

Disadvantages
The initial cost of installing LAN is quite high

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

3.CAN (Campus Area Network)


➢ Campus Area Network was shortly called the CAN. Office, school, any area that presented at a
limited distance is called the campus.
➢ The Providing of the network at a particular location is called a Campus Area Network.
➢ The purpose of the CAN is to share computer resources with each other and to make private
network among the organization.
➢ Example: Networks that cover schools, colleges, buildings, etc.

Advantages Disadvantages
o Cost effective o Maintenance
o Easy Data Transfer o Limited connection
o Using the Internet Service Provider o Less speed

4.MAN (Metropolitan Area Network)


➢ A metropolitan area network is a network that covers a larger geographic area by
interconnecting a different LAN to form a larger network.
➢ In MAN, various LANs are connected to each other through a telephone exchange line. (Or) MAN
connects several LANs together
➢ It is designed to extend over an entire city.
➢ Range up to 100kms
➢ Example:- Cable TV network, Branches of a particular Bank with in a city are connected.
Advantages
o Fast communication using high
speed carriers like fiber optic cables
o Excellent support for an extensive
size of network (Easy to add new
network)
o To transmit data in both the
directions concurrently
Disadvantages
o Expensive
o Need more cable to establish the new
connection (to add one more LAN
network)

5.WAN (Wide Area Network)


➢ A wide-area network (WAN) is a form of computer network that links computers across long
distances via a common communication channel.
➢ A WAN is also defined as a collection of local area networks that communicate with one another.
➢ Example: The internet.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

➢ The internet is one of the biggest WAN in the world.


➢ A Wide Area Network is widely used in the field of Business, government, and education.
➢ Range up to 1000kms
Advantages
➢ Geographic coverage
➢ Data is centralized
➢ Worldwide business
➢ Message exchange
Disadvantages
➢ Security Issue
➢ Needs Firewall and antivirus
software
➢ High Setup Cost

Unicast
➢ It sends data from one source to only a single destination.
➢ In this case, there is just one sender and one receiver.
➢ This types of message are most commonly used on the peer-to-peer network or in a single node
topology, where only a single device is directly connected to another device to create a network.

Multicast
➢ It sends data from one device to multiple devices connected to the network.
➢ The switch is the best example for multicasting device.
➢ This networking device can deliver the data to a particular destination user wants to send.

Broadcast
➢ It sends data from one device to all the other devices connected to the network.
➢ Hub is the best example of a broadcasting device.
➢ This networking device cannot deliver data to a particular user in the network.
➢ Instead of this, it delivers data to all the connected devices in the network.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Protocol and Standards


Protocol
➢ A protocol is a set of rules that govern data communications.
➢ A protocol defines what is communicated, how it is communicated, and when it is
communicated.
➢ The key elements of a protocol are syntax, semantics, and timing.
1. Syntax:
❖ The term syntax refers to the structure or format of the data, meaning the order in
which they are presented.
❖ For example, a simple protocol might expect the first 8 bits of data to be the address of
the sender, the second 8 bits to be the address of the receiver, and the rest of the stream
to be the message itself.
2. Semantics:
❖ The word semantics refers to the meaning of each section of bits.
❖ How are a particular pattern to be interpreted, and what action is to be taken based on
that interpretation?
3. Timing:
❖ The term timing refers to two characteristics: when data should be sent and how fast
they 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 some data will be lost.
Standards
Standards are essential in creating and maintaining an open and competitive market for equipment
manufacturers and in guaranteeing national and international interoperability of data and
telecommunications technology and processes.
1. International Organization for Standardization (ISO).
2. International Telecommunication Union-Telecommunication Standards Sector (ITU-T).
3. American National Standards Institute (ANSI).
4. Institute of Electrical and Electronics Engineers (IEEE).
***********
Reference model
➢ In computer networks, reference models give a conceptual framework that standardizes
communication between heterogeneous networks.
➢ The two popular reference models are −
1. OSI Model
2. TCP/IP Model
OSI Model
➢ OSI or Open System Interconnection m0odel was developed by International Standards Organization (ISO)
introduced in 1970.
➢ The OSI model is a layered framework for the design of network systems that allows communication
between all types of computer systems.
1. Physical Layer
➢ It is responsible for the actual physical connection between the devices (Transmission
medium).
➢ The physical layer contains information in the form of bits (0’s and 1’s).
➢ The main functionality of the physical layer is to transmit the individual bits from one node to
another node.
Function
➢ Representation of bits (0’s and 1’s)
➢ Line configuration (P2P or Multipoint)
➢ Topology (Star or mush etc.,)
➢ Transmission mode (simplex or duplex)

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

2.Data link layer


➢ It provides a reliable and efficient communication between two or more devices.
➢ It is mainly responsible for the unique identification of each device that resides on a local network.
➢ The main function of this layer is to make sure data transfer is error-free from one node to another.
➢ When a packet arrives in a network, it is the responsibility of DLL to transmit it to the Host using its MAC
address.
➢ It contains two sub-layers:
o Logical Link Control Layer
❖ The LLC layer controls frame synchronization, flow control and error
checking.
o Media Access Control Layer
❖ It is used for transferring the packets over the network.
Function
➢ Framing: Stream of bits into manageable data units
➢ Physical addressing: add MAC address to frames
➢ Error control: It detects and retransmits damaged or lost frames.
➢ Flow Control: The flow of data is controlled
➢ Access control: Device has control over the channel (time control)
3.Network layer
➢ The network layer works for the transmission of data from one host to the other host in different
networks.
➢ The sender & receiver’s IP addresses are placed in the header by the network layer.
➢ It also takes care of packet routing i.e. selection of the shortest path to transmit the packet, from the
number of routes available.
➢ It acts as a network controller.
Function
o Addressing: is used to identify the device on the internet.
o Routing: it determines the best optimal path out of the multiple paths
4. Transport Layer
➢ The Transport Layer provides transparent transfer of data between end systems, or hosts, and is
responsible for end-to-end error recovery and flow control.
➢ The delivery of data packets is managed by the transport layer
➢ It also manages the flow of data, segmentation and De-segmentation and error control.
➢ Fragmentation and reassembly of data packets - Fragmentation is the process of breaking a packet into
smaller pieces so that they will fit into the frames of the underlying network. The receiving system
reassembles the pieces into the original packets.
➢ The two protocols used in this layer are:
Transmission Control Protocol
• It establishes and maintains a connection between hosts.
• It offers an acknowledgment of the successful data transmission.
• If data lost retransmit the data again (not receive the acknowledgment)
User Datagram Protocol
o It is a connection less between hosts.
o It is an unreliable transport protocol.
o It does not wait for any acknowledgment.
o In this protocol data loss is occurred.
Function
➢ Service point addressing - port address is necessary for delivery
➢ Segmentation and reassembly -A message divided into number of segments (sequence of number)
from sender side and receiver reassemble the segment
➢ Connection control (connection or connection less)
5.Session Layer
➢ This layer is responsible for the establishment of connection, maintenance of sessions,
authentication, and also ensures security.
➢ Function
1. Session establishment, maintenance, and termination:
➢ The layer allows the two processes to establish, use and terminate a connection.
2. Synchronization:
➢ Session layer adds some checkpoints when transmitting the data in a sequence.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

➢ If some error occurs in the middle of the transmission of data, then the transmission
will take place again from the checkpoint.
➢ This process is known as Synchronization and recovery.
3. Dialog Controller:
➢ The session layer allows two systems to start communication with each other in
half-duplex or full-duplex.
6.Presentation Layer
➢ A Presentation layer is mainly concerned with the syntax and semantics of the information exchanged
between the two systems.
➢ The presentation layer is also called the Translation layer.
Function
• Translation:
For example, ASCII to EBCDIC.
• Encryption/ Decryption:
➢ Data encryption translates the data into another form or code.
➢ The encrypted data is known as the cipher text and the decrypted data is known as plain text.
➢ A key value is used for encrypting as well as decrypting data.
• Compression:
Reduces the number of bits that need to be transmitted on the network.
7.Application Layer
➢ Application layer interacts with an application program, which is closest to the end-user. (Human Machine
Interface)
➢ It allows users to interact with the software application.
➢ Example web browser, file transfer, email, remote login, etc.
Function
➢ Network Virtual Terminal (log on to a remote host)
➢ FTAM-File transfer access and management (transfer file)
➢ Mail Services (E-mail)
➢ Directory Services (to access global information)
OSI Architecture

**********

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

TCP/IP Reference Model


➢ The TCP/IP model refers to the Transmission Control Protocol/Internet Protocol Model.
➢ The first version of TCP/IP was ARPANET (1975), which stands for Advanced Research Projects
Administration Network. The name changed to TCP/IP in 1983, when it became an open standard that
could be used on any network.
➢ This model is a part of the network domain designed specifically for overseeing efficient and error-free
transmission of data.
➢ TCP/IP Model helps you to determine how a specific computer should be connected to the internet and
how data should be transmitted between them.
➢ It helps you to create a virtual network when multiple computer networks are connected together.
➢ The purpose of TCP/IP model is to allow efficient communication over large distances and error-free
transmission of data.
Four Layers of TCP/IP model

TCP/IP protocol suite

Application Layer

➢ Application layer interacts with an application program, which is closest to the end-user. It means
application layer allows users to interact with other software application to implement a communicating
component.
➢ It maintains a smooth connection between the application and user for data exchange.
➢ Example: file transfer, email, remote login, etc.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Some of the protocols used in this layer are:


1. HTTP: Hypertext transfer protocol is used for accessing the information available on the internet.
2. SMTP: Simple mail transfer protocol, assigned the task of handling e-mail-related steps and issues.
3. FTP: This is the standard protocol that oversees the transfer of files over the network channel.
4. SNMP: SNMP stands for Simple Network Management Protocol. It is a framework which is used for
managing the devices on the internet by using the TCP/IP protocol.
5. DNS: DNS stands for Domain Name System. An IP address that is used to identify the connection of a host
to the internet uniquely. However, users prefer to use names instead of addresses for that DNS.
6. TELNET:TELNET stands for Terminal Network. It establishes the connection between the local and
remote computer. It established connection in such a manner that you can simulate your local system at the
remote system.
Transport Layer
➢ This layer is responsible for establishing the connection between the sender and the receiver device and
also performs the task of dividing the data from the application layer into packets, which are then used
to create sequences.
➢ It also performs the task of maintaining the data, i.e., to be transmitted without error, and controls the
data flow rate over the communication channel for smooth transmission of data.

The protocols used in this layer are:


1. TCP: Transmission Control Protocol is responsible for the proper transmission of segments over the
communication channel. It also establishes a network connection between the source and destination system.
2. SCTP stands for Stream Control Transmission Protocol. It is a connection- oriented protocol in
computer networks which provides a full-duplex association i.e., transmitting multiple streams of data
between two end points at the same time that have established a connection in network.
3. UDP: User Datagram Protocol is responsible for identifying errors, and other tasks during the transmission
of information. UDP maintains various fields for data transmission such as:
✓ Source Port Address: This port is responsible for designing the application that makes up the
message to be transmitted.
✓ Destination Port Address: This port receives the message sent from the sender side.
✓ Total Length: The total number of bytes of the user datagram.
✓ Checksum: Used for error detection of the message at the destination side.
Internet Layer

➢ The main work of this layer is to send the packets from any network, and any computer still they reach
the destination irrespective of the route they take.
➢ The Internet layer offers the functional and procedural method for transferring variable length data
sequences from one node to another with the help of various networks.
Function
1. It is responsible for specifying the path that the data packets will use for transmission.
2. This layer is responsible for providing IP addresses to the system for the identification matters over
the network channel.
Some of the protocols applied in this layer are:
1. IP: This protocol assigns your device with a unique address; the IP address is also responsible for routing
the data over the communication channel.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

2. ARP: This protocol refers to the Address Resolution Protocol that is responsible for finding the physical
address using the IP address.
3. RARP: The RARP retrieves a computer's logical address from its available server.
4. ICMP: The Internet Control Message Protocol (ICMP) is a network layer protocol used by network devices
to diagnose network communication issues. ICMP is mainly used to determine whether or not data is
reaching its intended destination in a timely manner.
5. IGMP: The Internet Group Management Protocol (IGMP) is a protocol that allows several devices to share
one IP address so they can all receive the same data.
Host to Network

➢ This layer is the combination of data-link and physical layer.


➢ It helps you to defines details of how data should be sent using the network.
➢ The responsible for maintaining the task of sending and receiving data in raw bits (0’s and 1’s), i.e., in binary
format over the physical communication modes in the network channel.
➢ It uses the physical address of the system for mapping the path of transmission over the network channel.
Advantages
• It supports many routing-protocols.
• TCP/IP model has a highly scalable client-server architecture.
• It can be operated independently.
• Supports a number of routing protocols.
• It can be used to establish a connection between two computers.
Disadvantages
• TCP/IP is a complicated model to set up and manage.
• In this, model the transport layer does not guarantee delivery of packets.
• Replacing protocol in TCP/IP is not easy.
************
A Comparison of the OSI and TCP/IP Reference Models
S.NO OSI MODEL TCP/IP MODEL
1. It is developed by ISO (International It is developed by ARPANET (Advanced Research
Standard Organization) Project Agency Network).
2. OSI refers to Open Systems Interconnection. TCP refers to Transmission Control Protocol.
3. OSI follows a vertical approach. TCP/IP follows a horizontal approach.
4. OSI layers have seven layers. TCP/IP has four layers.
5. Strict layered Loosely layered
6. Model was developed before the development Protocols were developed first and then the model was
of protocols developed
7. It provides a clear distinction between It doesn’t have any clear distinguishing points between
interfaces, services and protocols services, interfaces and protocols.
8. It has separate session and presentation layer It combines the session and presentation layer in
application layer
9. The transport layer in this model provides a In this model, the transport layer does not have any such
packet delivery protocol. protocols.
10. The transport layer guarantees the delivery The transport layer does not guarantee the delivery of
of packets packets
11. The network layer to define routing TCP/IP uses only the internet layer
standards and protocols
12. The data link layer and physical are separate In TCP, physical and data link are both combined as a
layer single host-to-network layer or network interface
***********

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Transmission Media
➢ Transmission media is a communication channel that carries the information from the sender to the
receiver.
➢ Data is transmitted through the electromagnetic signals.

Wired / Guided Media


Transmitted data travels through cabling system (wire) that has a fixed path.
1. Twisted Pair cable
2. Coaxical cable
3. Fibre optic cable
1. Twisted Pair Cable
➢ A twisted pair cable is a pair of copper wire.
➢ Copper Wire are the most common wires used for
transmitted signal (good transmitter with low
cost)
➢ It consists of two conductors (normally copper),
each with its own plastic insulation, twisted
together toform a single media.
➢ Out of these two only one carries signal, others is
used for ground reference.
➢ To identify every cable, these cables are colour
coated.

Two Types of Twisted Pair Cable


1. Unshielded Twisted Pair Cable
2. Shielded Twisted Pair Cable

Unshielded Twisted Pair


➢ It has ability to block interference (crosstalk) and doesn’t depends on a physical shield.
➢ UTP is widely used in telecommuncation

Advantages Disadvantages
o Least expensive o This cable can only be used for shorter
o Easy to install distances because of attenuation.
o High capacity

Application
o Telephone connection and LAN network.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Shielded Twisted Pair


➢ It is a cable that contains the mesh (metal foil covering) surrounding the wire that allows the
higher transmission rate.
➢ This type of cable consists of a special jacket to block external interference.
Advantages
o It provides high transmission rate
o Easy to install
o Cost is not very high and not very low
o Eliminates crosstalk

Disadvantages
o It has a higher attenuation rate
o It is more expensive compared with
UTP and coaxible cable.
Application
o Extermely Cold Climate (to prevent
from temperature)

2. Coaxial Cable
➢ Coaxial cable is very commonly used transmission media.
➢ It transmitted signals may travel longer distances at higher speeds.
➢ The shield minimizes electrical and radio frequency interference.
➢ Example:- Cable TV, Telephone and computer network(Internet)

It consists of 4 primary components,as follows:


➢ A core copper wire as its centre
➢ This copper wire is surrounded by a plastic insulator or dielectic
➢ Over this is a mesh shield which is made up of a conducting material.
➢ This last layer called as the outer jacket is made of Plastic coating
Common cable standard
Coaxical cable designs are categorized by their radio government (RG) rating.
o RG-8 , RG-9, RG-11 -> Used in thick Ethernet
o RG-58 -> Used in the thin Ethernet
o RG-59 -> Used for T.V
Advantages
o It provide excellent noise immunity

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

o Signals can travel longer distances at higher speed


o Easy to install and maintain
Disadvantages
o Expensive as compared to Twisted Pair Cable
o It is bulky
o In case of any damage the entire network goes down as a single cable is used for transmission.

3. Fibre Optical Cable


➢ A fibre optical cable is made of high quality of thin glass or plastic and is used to transfer Digital
signals are transmitted in the form of light signal.
➢ Light is lanuched into the fiber at one end using a light source such as Light Emitting
Diode(LED) or Injection Laser Diode(ILD).
➢ For data transmission, the transmitter must be capable of inducing data bits 0 to 1 into the light
source.At receiver’s end a photodiode is used to transmit this light back into data bits.

➢ The cable consists of one or more strands of glass, each only slightly thicker than a human
hair.The centre of each strand is called the core, which provides the pathway for light to travel.
➢ The core is surrounded by a layer of glass called cladding that reflects light inward to avoid loss
of signal and allow the light to pass through bends in the cable.
➢ No light ecapes the glass core because of this reflective cladding.

Advantages Disadvantages
o High rate signal can be transmit o Optical fibre cables are expensive
o No crosstalk o Difficult to install
o Large bandwidth , Greater Capacity o Maintenance is expensive and difficult
(2Gbps)
o Smaller size and lighter weight
o Lower attenuation
o Immunity to environment
o Highly secure
o Repeaters are not required
*******
Wireless / Unguided Media
Transmitted data travels through lighting or signal (wireless)
1. Radio waves
2. Micro waves
3. Infrared waves
1. Radio Waves
➢ Electromagnetic waves ranging in frequencies between 3kHz to 1GHz are normally called radio
waves.
➢ When an antenna transmit radio waves in all directions (omnidirectional).
➢ Radio waves that propagate in the sky mode, can travel long distance.
➢ Radio waves are good at bending around buildings and hills

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

2. Microwaves
➢ Electromagnetic waves having frequencies between 1 to 300 GHz are called microwaves.
➢ It travel in straight lines (uni direction), it allows multiple receivers.
➢ When an antenna transmit microwaves, this means that the sending and receiving antennas
need to be narrowly focused.
➢ Microwaves are often refracted by the atomspheric layers.

Advantages
o Cheaper than using cables
o It don’t require any land for the installation of cables.
o Communication over oceans
Disadvantages
o Susceptible to weather condition
o Eavesdropping : any malicious user can catch the signal in the air by using its own.
Application
o Cellular phones
o Television networks

3. Infrared Waves
➢ Frequencies from 300GHz to 400GHz (wavelengths from 1mm
to 770nm)
➢ It can be used for short range communication (upto 5 meters)
➢ Purpose such as television and its remote.
➢ Infrared cannot cross wall-like obstacles.
➢ Example:- TV Remote Control, DVD players,wireless mouse,
keyboard, printer, etc..
************

Introducing to Encoding
➢ Information must be encoded into signals before it can be transported across communication
media.
➢ Encoding refers to converting data into a different form, while decoding is the opposite data is
converted back to its original form.
➢ The conversion methods used for data transmission:
1. Digital-to-Digital Conversion
2. Analog-to-Digital Conversion

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

3. Digital-to-Analog Conversion
4. Analog-to-Analog Conversion
1. Digital-to-Digital Conversion (Line Coding)
The binary signals created by your computer are translated into a sequence of voltage pulses that can be sent
through the transmission medium.

Unipolar
➢ Digital transmission system sends the voltage pulses over the medium link such as wire or cable.
➢ In most types of encoding, one voltage level represents 0, and another voltage level represents
1.
➢ The polarity of each pulse determines whether it is positive or negative.
➢ This type of encoding is known as Unipolar encoding as it uses only one polarity.
Assume,
1s are represented as a positive value and 0s are represented as a Negative value.

Polar
Polar encoding is an encoding scheme that uses two voltage levels: one is positive, and another is
negative.

The two most common methods used in NRZ (Nonreturn Zero) are:
➢ NRZ-Level: In NRZ-L encoding, the level of the signal depends on the type of the bit that it
represents. If a bit is 0 or 1, then their voltages will be positive and negative respectively.
Therefore, we can say that the level of the signal is dependent on the state of the bit.
Assume,
0’s are represented as a positive value and 1’s are represented as a Negative value.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

➢ NRZ-Invert: NRZ-I is an inversion of the voltage level that represents 1 bit. In the NRZ-I
encoding scheme, a transition occurs between the positive and negative voltage that represents
1 bit. In this scheme, 0 bit represents no change and 1 bit represents a change in voltage level.
Assume,
0’s are represented as a positive value and 1’s are represented as a Negative value.
0 = No change , 1=Change (alternate one)

RZ
➢ RZ stands for Return to zero.
➢ RZ is an encoding scheme that provides three values, positive voltage represents 1, the negative
voltage represents 0, and zero voltage represents none.
➢ In the RZ scheme, halfway through each interval, the signal returns to zero.
➢ In RZ scheme, 1 bit is represented by positive-to-zero and 0 bit is represented by negative-to-zero.

Hint:-

Biphase
➢ Biphase is an encoding scheme in which signal changes at the middle of the bit interval but
does not return to zero.

Manchester
➢ It changes the signal at the middle of the bit interval but does not return to zero for synchronization.
➢ In Manchester encoding, a negative-to-positive transition represents binary 1, and positive-to-negative
transition represents 0. Hint:-

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

Differential Manchester
➢ It is also known as Bi-phase mark code.
➢ In Differential Manchester Encoding 0 should contain an edge but 1 should not contain any edge it
should be continuous
Hint

Bipolar
➢ Bipolar encoding scheme represents three voltage levels: positive, negative, and zero.
➢ In Bipolar encoding scheme, zero level represents binary 0, and binary 1 is represented by
alternating positive and negative voltages.
➢ If the first 1 bit is represented by positive amplitude, then the second 1 bit is represented by
negative voltage, third 1 bit is represented by the positive amplitude and so on. This
alternation can also occur even when the 1bits are not consecutive.

2. Analog-To-Digital Conversion
o When an analog signal is digitalized, this is called an analog-to-digital conversion.
o Suppose human sends a voice in the form of an analog signal, we need to digitalize the analog
signal.
o It requires a reduction in the number of values in an analog message so that they can be
represented in the digital stream.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

o
Techniques for Analog-To-Digital Conversion
PAM
➢ PAM stands for pulse amplitude modulation.
➢ PAM is a technique used in analog-to-digital conversion.
➢ PAM technique takes an analog signal, samples it, and generates a series of digital pulses
based on the result of sampling where sampling means measuring the amplitude of a signal at
equal intervals.

PCM
➢ PCM stands for Pulse Code Modulation.
➢ PCM technique is used to modify the pulses
created by PAM to form a digital signal. To
achieve this, PCM quantizes PAM pulses.
Quantization is a process of assigning integral
values in a specific range to sampled
instances.
➢ PCM is made of four separate processes: PAM,
quantization, binary encoding, and digital-to-
digital encoding.

Encoding:
In encoding, each approximated value is then converted into binary format.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

3. Digital to Analog Conversion:


3.1 Amplitude-shift keying (ASK)

In ASK, only the amplitude of the carrier signal is modified in modulation. The simplest version is on–off
keying (OOK). In OOK, either bursts of a carrier wave are transmitted or nothing is transmitted depending
whether the input message signal is 1 or 0. Other versions of ASK use differing (non-zero) amplitudes to
represent 1 and 0.

3.2 Frequency-shift keying (FSK)


In FSK, the frequency of the carrier signal is modified. Here, bursts of a carrier wave at one frequency or
bursts of a carrier wave at a second frequency are transmitted according to whether the input data is 1 or 0.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

3.3 Phase-shift keying (PSK)


➢ The third fundamental digital modulation technique, and the most widely used in one form or
another, is PSK. Its simplest form is Binary Phase-Shift Keying (BPSK).
➢ In BPSK, 0 and 1 are represented by segments of sinusoids that differ in their phase. At the
receiver, distinguishing between the two segments is easier if their phases differ by as much as
possible.

4. Analog to Analog Conversion (Modulation):


➢ Analog Signal: An analog signal is any continuous signal for which the time varying feature of the
signal is a representation of some other time varying quantity i.e., analogous to another time
varying Signal.
➢ Analog-to-analog conversion, or modulation, is the representation of analog information by an
analog signal. It is a process by virtue of which a characteristic of carrier wave is varied according
to the instantaneous amplitude of the modulating signal.

Types of Modulation
1. Amplitude modulation
2. Frequency modulation
3. Phase modulation

4.1 Amplitude modulation


The Amplitude modulation means the changing of Properties of the carrier signal according to the
Properties of the modulated signal.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

4.2 Frequency modulation


The Frequency modulation means the changing of Properties of the carrier signal according to the
Properties of the modulated signal.

4.3 Phase modulation


The phase modulation means the changing of Properties of the carrier signal according to the Properties of
the modulated signal.

Transmission Impairment
➢ When a signal transmit from one medium to other, the signal that is received may differ from
the signal that is transmitted due to various impairments.
➢ The most significant impairments include
1) Attenuation – It refers to lose of energy by a signal time.
2) Distortion – Signal changes its form of shape
3) Noise – may be corrupt the signal.

***************

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 1 Computer Networks

CN - Question Bank
Part A
1) Draw a hybrid topology with a star backbone and four ring networks?
2) What is the significance of twisting in twisted pair cable?
3) For ‘n’ devices in a network, what is the number of cable linkes required for mesh,ring and
star topology?
4) List the layers is the OSI model that handle end-to-end connections.
5) Consider a data stream consisting of ten 0’s. Encode this stream using the following
encoding schemes. Compare the number of transitions that occur in the encoded
streams.(a) NRZ-L (b) Manchester
6) What is multicast? What is the difference between unicast and multicast?
7) Differentiate between Logical Address and Physical Address.
8) What is Modem technology?
9) What is the purpose of RJ 45 cable?
10) Determine the total number of links needed for N nodes connected as (a) mesh (b) star (c)
ring topology?
11) Define the term Protocol and give its key element.
12) State the major functions performed by the translation layer of the ISO OSI model.
13) What is the major difference between connection oriented and connectionless
communication?
14) What are the responsibilities of Data Link Layer?
15) Differentiate between Unicasting and multicasting.
16) Write briefly about ring topology?
17) Define Network?
18) Define Data Communication.
19) Differentiate between OSI and TCP/IP suite.
20) Draw the structure of a Switch.
Part B
1) Discuss about the layers of ISO-OSI model
2) Discuss different types of guided and unguided transmission media with neat diagrams
3) Explain Network Design.
4) Explain digital data and digital signals.
5) Differentiate between TCP/IP and OSI Reference model.
6) Explain the Services of Transport layer.
7) Explain Network Architecture.
8) What is a protocol? List the three key elements of a protocol.
9) With relevant examples differentiate between simplex, half duplex and full duplex
communication.
10) Draw the digital to digital encoding technique (line coding) for 10100101.
11) Explain the star and bus topologies of computer networks.
12) Explain Encoding techniques.
13) Explain Network topology.
14) Explain transmission mode.
15) Explain the following
(a) Digital to Digital Conversion
(b) Analog to Digital Conversion
(c) Digital to Analog Conversion
(d) Analog to Analog Conversion
****************

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

UNIT II
Data link Layer
Channelization, Multiplexing, Framing, Error Detection and Correction, Flow Control-Sliding
Window Protocols, Medium Access Control sub layer, Basic Structure of a Switch, Circuit
Switching and Packet Switching, Ethernet, Introduction to IEEE 802 standards.

Multiplexing
 The set of techniques that allows the simultaneous transmission of multiple signals
across a single data link is commonly referred to as Multiplexing.
 The Multiplexer (MUX) mainly combines 'n' input lines in order to generate '1' output
line(this is simply many-to-one) on the sender side.
 And on the receiver side, this stream is fed into the demultiplexer (DEMUX), which then
separates the stream back to its component transmission (this is one-to-many)
Example:-
Let's take a TV cable distributor as an example, which transmits numerous channels via a
single wire.
Advantages:
o More than one signal can be sent over a single medium.
o The bandwidth of a medium can be utilized effectively.

Types of Multiplexing

1 . Frequency-division Multiplexing (FDM)


 Frequency division Multiplexing is a sort of multiplexing in which the bandwidth of a
single physical medium is divided into several smaller, independent frequency
channels.
 It is mainly used when the link's bandwidth is greater than the combined bandwidths of the
signals to be sent.
 Frequency Division Multiplexing (FDM) is an analog technology.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

 Each signal in FDM has a different frequency.


 If the input signal for frequency division multiplexing is digital, it must be converted to
analog before being sent to the modulator.

 The modulation process splits the input


signals into frequency bands, which are
then combined to generate a composite
signal.
 We can see a lot of inter-channel cross-talk
in FDM since the bandwidth is divided into
frequency channels. So to prevent inter-
channel cross-talk, we must place some
unused bandwidth strips between every
channel. These unused bandwidth strips are
called guard bands.

Advantages
o The Simultaneous transmission of a large number of signals is done easily.
o The demodulation of FDM multiplexing is easy.
o In the case of slow narrowband fading, there is only one single channel that gets
affected

Disadvantages
o When employing FDM, the problem of cross-talk arises.
o The bandwidth of communication channels must be quite large.

Applications
o One of the main applications of FDM is that it is FM radio broadcasting.
o Another application of FDM is that it is used in television broadcasting.
o FDM is also used by first-generation cellular telephones.

2 . Wavelength Division Multiplexing


 Wavelength Division Multiplexing is same as FDM except that the optical signals are
transmitted through the fibre optic cable.
 It is used to utilize the high data rate capability of fibre optic cable.
 It is an analog multiplexing technique.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

 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.
 Prism also performs a reverse operation, i.e., demultiplexing the signal.

Advantages
o With the help of WDM, full-duplex communication is possible.
o WDM allows multiple signals to be transmitted at the same time.
o This method is extremely secure.
o Since we use optical fiber in WDM, optical components are more reliable and
provide higher bandwidth.
Disadvantages
o It is less scalable.
o WDM is more expensive than FDM.
Application
o It is also used in radio frequency avionics (aeronautics).

3 . Time-Division Multiplexing
 Time-Divison multiplexing is a digital technique for multiplexing.

 In this technique, the channel/link is divided on the basis of time instead of frequency.
 The total available time on the channel is divided between the different users on the
channel.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

 A particular time interval is allotted to each user on the channel and it is known as
time slot/slice.
 In the time-division multiplexing, the data rate capacity should be much greater than
the data rate that is required by the sending and receiving device.
 There are two types of TDM:
1. Synchronous TDM
2. Asynchronous TDM

3.1 Synchronous TDM


 A Synchronous TDM is a technique in which time slot is pre-assigned to every device.
 In Synchronous TDM, each device is given some time slot irrespective of the fact that
the device contains the data or not.
 If the device does not have any data, then the slot will remain empty.
 In Synchronous TDM, signals are sent in the form of frames. Time slots are organized
in the form of frames. If a device does not have data for a particular time slot, then
the empty slot will be transmitted.
 If there are n devices, then there are n slots.

Advantages
 This technique is easy to implement.
Disadvantages
 If a user has no data to transmit in that case time slots will get wasted.
 In this multiplexing, the capacity of the transmission link must be always higher
than the total capacity of the input lines.

3.2 Asynchronous TDM


 An asynchronous TDM is also known as Statistical TDM.
 An asynchronous TDM is a technique in which time slots are not fixed as in the case of
Synchronous TDM. Time slots are allocated to only those devices which have the data
to send. Therefore, we can say that Asynchronous Time Division multiplexor
transmits only the data from active workstations.
 An asynchronous TDM technique dynamically allocates the time slots to the devices.
 In Asynchronous TDM, total speed of the input lines can be greater than the capacity
of the channel.
 Asynchronous Time Division multiplexor accepts the incoming data streams and
creates a frame that contains only data with no empty slots.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Bandwidth
 It describes the maximum data transfer rate of a network or internet connection.
 It measures how much data can be sent over a specific connection in a given
amount of time.
Channel
 A communication channel is the medium used to transport information from sender to
receiver

**************
Framing
 The data link layer receives packets from the network layer and converts them into
frames.
 If the frames size is too large, then the packets are divided into smaller frames for
efficienct flow control and error control

Parts of a Frame
 Frame Header − It contains the source and the destination addresses of the frame.
 Payload field − It contains the message to be delivered (data).
 Trailer − It contains the error detection and error correction bits.
 Flag − It marks the beginning and end of the frame.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Types of Framing

Fixed size framing


 The size of the frames are fixed
 Frame length itself acts as a delimiter

Variable Size Framing


 The Size of the frames must be different
 In variable size framing, we need a way to define the end of the frame and the
beginning of the next frame.

Two approaches for variable size framing:-


1.Character Oriented Framing (or) Byte Oriented Framing
2.Bit Oriented Framing

1 . Character Oriented Framing


 Byte stuffing is the process of adding an extra byte when there is a flag or escape
character in the text.
 The data to be carried are 8-bit characters
 It was popular when only text was exchanged between data link link layers

1. Flag : 8-bit character added to the beginning and end of each frame
2. Header : Carries source and destination address and other control information
3. Data : Data from network layer
4. Trailer : Carries redundant bits for error detection

Problem
 The flag we send could be a part of the data
 When receiver detects the flag character in the middle of the data, thinks it has
reached the end of the frame

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

 To fix this problem, byte stuffing/character stuffing strategy is used

Byte Stuffing
 A special character/byte is added to the data section of a frame when there is a
character with the same pattern as the flag.
 This byte is called escape character (ESC) and has a predefined bit pattern.
 Whenever the receiver encounters the escape character (ESC) it removes from the
data section and treats the next character as data.

Problems with this type of framing


 It adds too much extra bytes to the data which increased the frame size
 The universal coding systems such as Unicode use 16-bit and 32-bit characters that
conflict with 8-bit characters.

2 . Bit Oriented Framing


 The data section of a frame is a sequence of bits
 A special 8-bit pattern is added to the beginning and end of each frame
 The 8-bit pattern is 01111110

Problem
 The 8-bit flag pattern may appear in the data
 When receiver detects the pattern in the middle of the data, thinks it has reached
the end of the frames
 To fix this problem, bit stuffing strategy is used.

Bit stuffing
 In bit stuffing if the 8-bit flag pattern is encountered in the data, an extra 0 is added
after five 1’s to prevent the pattern from looking like the flag.
 This extra bit is removed by the receiver.

*************

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Error Correction and Error Detection


 Error correction and error detection techniques are work on the data-link layer.
 The data link layer ensures the frames are sent from the sender to the receiver with
accuracy.
 Error detection methods are used to check whether the receiver has received correct
data or corrupted data.
 Error correction is used to correct the detected errors during the transmission of data
from sender to receiver.
 Example for error, the sender sends the 0101010 data, and the receiver receives the
1101010.( doesn't match with the sender data)
Types of Error
1. Single bit error
 In the single-bit error, only one bit is changed in the frame.
 For example, the sender sends the data (0101) in the frame, and the receiver
receives the data (1101) in the frame.

2. Burst error
 In the burst error, one or more than one bits are changed in the frame.
 For example, the sender sends the data (0101) in the frame, and the receiver
receives the data (1111) in the frame.

Detection
 In the error checking process the errors are detected first and then errors are
corrected
 The main concept of error detection and error correction is redundancy.

Method 1:- Sending every data twice


 One error detection mechanism is to send every data unit twice, so that
receiver checks every bit of the two copies and detects the error.
Drawback:-
 Transmission time is doubled
 Bit by bit comparison takes more time

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Method 2:-Extra bits are added with data (Redundancy Bits)


 Instead of transmitting entire data twice, a shorter group of bits may be
appended to the end of each unit.
 This is called redundancy or redundancy bits (adds some extra bits).
 The sender adds these redundant bits, and the receiver eliminates these
redundant bits.

Types of error detection techniques:


1. Parity Checking
2. Checksum
3. Cyclic Redundancy Check (CRC)

1. Parity Checking
Simple Parity-Check
 Parity Checking is also known as the Vertical redundancy check (VRC). Parity
checking is a very simple technique.
 Encoder and decoder for simple parity-check code

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Odd parity Even parity


If the total number of 1's is odd in the If the total number of 1's is even in the
frame, 1 is added in the frame. frame, 0 is added in the frame.

Two-Dimensional Parity Check


 Longitudinal Redundancy Check (LRC) is also known as 2-D parity check.
 For each row, parity check bits are calculated, which is identical to a basic parity check
bit.
 For each column, parity check bits are computed and transmitted together with the
data.
 These are compared with the parity bits calculated on the received data at the
receiving end.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Disadvantages or Drawbacks
 If 2 bits are corrupted in 1 data unit and another data unit exactly at the same
position is corrupted then this method is not able to detect the error.
 Sometimes this method is not used for **detecting 4-bit **errors or more than
4-bit errors.

2 . Checksum
 A Checksum is an error detection technique based on the concept of redundancy.
Hint:-
Checksum = check + sum
Sender side = Checksum Creation
Receiver side = Checksum Validation

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Checksum Procedure on Sender side


1. Break the original message (data) in to ‘k’ number of blocks with ‘n’ bits in each
block.
2. Sum all the ‘k’ data blocks
3. Add the carry to the sum, if any.
4. Do 1’s complement for sum value, we get checksum
5. Checksum is appended to the end of original message (data) and is then transmitted
to Receiver.
Checksum Procedure on Receiver side
1. Collect all the data blocks including the checksum
2. Sum all the data blocks with checksum
3. Do 1’s complement for sum value
4. If the result is zero accept else reject.

Example
Suppose that the sender wants to send 4 frames each of 8 bits, where the
frames are 11001100, 10101010, 11110000 and 11000011.
 The sender adds the bits using 1s complement arithmetic. While adding two
numbers using 1s complement arithmetic, if there is a carry over, it is added to the
sum.
 After adding all the 4 frames, the sender complements the sum to get the checksum,
11010011, and sends it along with the data frames.
 The receiver performs 1s complement arithmetic sum of all the frames including
the checksum. The result is complemented and found to be 0. Hence, the receiver
assumes that no error has occurred.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

3 . Cyclic Redundancy Check (CRC)


 The cyclic redundancy check was developed by W-Wesley Peterson in 1961.
 CRC is an alternative method for deter mining whether or not a received frame
includes valid data.
 The binary division of the data bits being
delivered is used in this approach.
 Polynomials are used to generate the
divisor.

CRC Procedure on Sender side


1. The sender divides the bits that are being transferred and calculates the remainder.
2. The sender inserts the remainder at the end of the original bits before sending the
actual bits.
3. A codeword is made up of the actual data bits plus the remainder.
4. The transmitter sends data bits in the form of codewords.
CRC Procedure on Receiver side
1. The receiver, on the other hand, divides the codewords using the same CRC
divisor.
2. If the remainder consists entirely of zeros, the data bits are validated;
3. Otherwise, it is assumed that some data corruption happened during transmission.

Example 1:
Original Message or Data word = 100100
Divisor = 1101

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Example 2:

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Error Correction Techniques – Hamming Code


 Hamming Code is a special code in a Computer network, which is a set of error-
correction codes.
 In Computer Graphics, it is mainly used for detecting and correcting errors that occur at
the time of data transmission from sender to receiver.
 The code is known as Hamming code because it was developed by R.W. Hamming to
detect and correct errors.
 The redundant bits and parity bits play an important role in detecting and correcting errors.
 Redundant bits are the extra binary bits that are added to the original data bits, which are
ready to transfer from sender to receiver for ensuring that no bits were lost during the data
transfer.
 Parity bits are the extra bits that are added to the original data(binary bits) so that the total
number of 1s is even or odd.

Steps to find the Hamming Code


The hamming method uses the extra parity bits to allow the identification of a single-bit
error.
Step 1 − First write the bit positions starting from 1 in a binary form (1, 10, 11,100, etc.)
Step 2 − Mark all the bit positions that are powers of two as parity bits (1, 2, 4, 8, 16, 32,
64, etc.)
Step 3 − All other bit positions are for the data to be encoded using (3, 5, 6, 7, 9, 10 and
11, etc.)
Each parity bit calculates the parity for some of the bits in the code word. The position of the
parity determines the sequence of bits that it alternatively checks and skips.
1. Position 1 − Check 1 bit, then skip 1 bit, check 1 bit and then skip 1 bit and so on (Ex −
1,3,5,7,11, etc.)
2. Position 2 − Check 2 bit, then skip 2 bit, check 2 bit, then skip 2 bit (Ex −
2,3,6,7,10,11,14,15, etc.)
3. Position 4 − Check 4 bit, then skip 4 bit, check 4 bit, then skip 4 bit (Ex − 4, 5, 6, 7, 12,
13, 14, 15, etc.)
4. Position 8 − Check 8 bit, then skip 8 bit, check 8 bit, then skip 8 bit (Ex − 8, 9, 10, 11, 12,
13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31).

7 bit Hamming Code => 4 bit data + 3 bit parity

Location 7 6 5 4 3 2 1
Bit Designation D7 D6 D5 P4 D3 P2 P1

12 bit Hamming Code => 8 bit data + 4 bit parity

Location 12 11 10 9 8 7 6 5 4 3 2 1
Bit Designation D12 D11 D10 D9 P8 D7 D6 D5 P4 D3 P2 P1

15 bit Hamming Code => 11 bit data + 4 bit parity

Location 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Bit Designation D15 D14 D13 D12 D11 D10 D9 P8 D7 D6 D5 P4 D3 P2 P1

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Hint:-
3 Bit Parity 4 Bit Parity
P1 = (1,3,5,7) P1 = (1,3,5,7,9,11,13,15)
P2 = (2,3,6,7) P2 = (2,3,6,7,10,11,14,15)
P4 = (4,5,6,7) P4 = (4,5,6,7,12,13,14,15)
P8 = (8,9,10,11,12,13,14,15)

Example 1
Assume that the EVEN Parity Hamming Code is 0100011 is received. Determine bit location
where error has occured.
Solution:-

7 bit Hamming Code => 4 bit data + 3 bit parity

Location 7 6 5 4 3 2 1
Bit Designation D7 D6 D5 P4 D3 P2 P1
Received Data 0 1 0 0 0 1 1

P1 = (1,3,5,7) (1,0,0,0) 1
P2 = (2,3,6,7) (1,0,1,0) 0
P4 = (4,5,6,7) (0,0,1,0) 1
Answer:-
(101)2 = (5)10 ( Error in 5th bit => Detect )
0100011 = 0110011 (Correct the error)
---------------------
Example 2
Assume that the ODD Parity Hamming Code is 101101101 is received. Determine bit location
where error has occured.
Solution:-
Total 9 bit Hamming Code (Here we use 12 bit frame )=> 5 bit data + 4 bit parity

Location 9 8 7 6 5 4 3 2 1
Bit Designation D9 P8 D7 D6 D5 P4 D3 P2 P1
Received Data 1 0 1 1 0 1 1 0 1

P1 = (1,3,5,7,9) (1,1,0,1,1) 1
P2 = (2,3,6,7) (0,1,1,1) 0
P4 = (4,5,6,7) (1,0,1,1) 0
P8 = (8,9) (0,1) 0
Answer:-
(0001)2 = (1)10 ( Error in 1st bit => Detect )
101101101 = 101101100 (Correct the error)

**********

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Flow Control
 Flow control is the management of data
flow between two communicating
devices or nodes in a network, so that
the data can be handling efficiently.

 Too much data arriving before a device


can handle it causes data overflow,
meaning the data is either lost or must
be retransmitted.

 A set of procedures which are used for


restricting the amount of data that a
sender can send to the receiver.

Stop-and-wait Protocol
 It works under the assumption that the communication channel is noiseless and transmissions are
error-free.

Working Procedure:-
1. The sender sends data to the receiver.
2. The sender stops and waits for the acknowledgment.
3. The receiver receives the data and processes it.
4. The receiver sends an acknowledgment for the above data to the
sender.
5. The sender sends data to the receiver after receiving the
acknowledgment of previously sent data.
6. The process is unidirectional and continues until the sender sends
the End of Transmission (EoT) frame.

Disadvantages (or) Drawback of Stop-and-Wait Protocol


1.Problems occur due to lost 2.Problems occur due to lost 3.Problem due to the delayed
data acknowledgment data or acknowledgment

Stop-and-wait ARQ Protocol


 The above 3 problems are resolved by Stop and Wait for ARQ (Automatic Repeat Request) that
does both error control and flow control.
 It is an improved and modified version of Stop and Wait protocol.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Example:-
Time Out <- Lost Data) Sequence Number (Data) <- Lost Ack Delayed Acknowledgement

Go-Back-N ARQ
 It uses the concept of protocol pipelining (ie) the sender can send multiple frames before
receiving the acknowledgement for the first frame.
 There are finite number of frames and the frames are numbered in a sequential manner.
 The number of frames that can be sent depends on the window size of the sender.
 If the Acknowledgement of a frame is not received within an agreed upon time period, all frames
in the current window are retransmitted.
Note:-
o N – Sender’s Window Size
o For example, if the sending window size is 4(22), then the sequence number will be 0,1,2,3, 0,1,2,3,
0,1, and so on.
o The number of bits in the sequence number is 2 to generate the binary sequence 00,01,10,11.

Example:-
1 . First, the sender sends the first four frames in the window (here the window size is 4). Then, the
receiver sends the acknowledgment for the 0th frame.

2 . The receiver then slides the window over and sends the next frame in the queue.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

3 . Acknowledgement not received in time

4 . If the Acknowledgement of a frame is not received within an agreed upon time period, all frames in the
current window are retransmitted

Selective Repeat ARQ


 In Selective Repeat ARQ,only the erroneous or lost frames are retransmitted, while correct
frames are received and buffered.
 The receiver while keeping track of sequence numbers, buffers the frames in memory and sends
NACK for only frame which is missing or damaged.
 The sender will send/retransmit packet for which NACK is received.
Example:-
1 . First, the sender sends the first four frames in the window (here the window size is 4). Then, the
receiver sends the acknowledgment for the 0th frame.

2 . The receiver then slides the window over and sends the next frame in the queue.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

3 . The receiver thus sends back a “NAK” signal or a non-acknowledgment to let the sender know
that frame 2 has been lost.

4 . And then the sender retransmits frame 2.

**********

Medium Access Control Sub Layer


 To coordinate the access to the channel, multiple access protocols are requiring.
 All these protocols belong to the MAC sub layer.
 Data Link layer is divided into two sub layers:
1. Logical Link Control (LLC)- is responsible for error control & flow control.
2. Medium Access Control (MAC)- MAC is responsible for multiple access to
shared medium

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Multiple Access Protocol


 Many protocols have been defined to handle the access to shared link.

Random Access Protocols


 In random access or contention methods, no station is superior to another station and
none is assigned the control over another.
 There is no rule that decides which station should send next.
 If two stations transmit at the same time, there is collision and the frames are lost.
 The various random access methods are:
1. ALOHA
2. CSMA (Carrier Sense Multiple Access)
3. CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
4. CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
ALOHA
 Aloha is a random access protocol
 It was actually designed for WLAN but it is also applicable for shared medium
 In this, multiple stations can transmit data at the same time and can hence lead to
collision and data being garbled.

There are two different versions of ALOHA:


1 . Pure ALOHA
 In pure ALOHA, stations transmit frames whenever they have data to send.
 When two stations transmit simultaneously, there is collision and frames are lost.
 When a station sends data it waits for an acknowledgement
 If the acknowledgement doesn’t come within the allotted time then the station waits
for a random amount of time called back-off time and re-sends the data.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

 If the first bit of a new frame overlaps with just the last bit of a frame almost
finished, both frames will be totally destroyed and both will have to be retransmitted
later.

2 . Slotted ALOHA
 It was developed just to improve the efficiency of pure aloha as the chances for collision
pure aloha are high.
 The time of the shared channel is divided into discrete time intervals called slots.
 Sending of data is allowed only at the beginning of these slots.
 If a station misses out the allowed time, it must wait for the next slot.
 This reduces the probability of collision.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Carrier Sense Multiple Access (CSMA)


 Carrier Sense Protocol
 To minimize the chance of collision and increase the performance, the CSMA method was
developed.
 Principle of CSMA : “Sense Before Transmit” or “listen before talk”
 Carrier Busy = Transmission is taking place
 Carrier Idle = No transmission currently taking place.
 The possibility of collision still exists because of propagation delay; a station may sense
the medium and find it idle, only because the first bit sent by another station has not yet
been received.

1-Persistent CSMA
 In this method, station that wants to transmit data continuously senses the channel
to check whether he channel is idle or busy.
 If the channel is busy, station waits until it becomes idle.
 When the station detects an idle channel, it immediately transmits the frame.
 This method has the highest chance of collision because two or more stations may
find channel to be idle at the same time and transmit their frames.
Non-Persistent CSMA
 A station that has a frame to send senses the channel.
 If the channel is idle, it sends immediately.
 If the channel is busy, it waits a random amount of time and then senses the
channel again.
 It reduces the chance of collision because the stations wait for a random amount of
time.
 It is unlikely that two or more stations will wait for the same amount of time and will
retransmit at the same time.
P-Persistent CSMA
 In this method, the channel has time slots such that the time slot duration is equal to or
greater than the maximum propagation delay time.
 When a station is ready to send, it senses the channel.
 If the channel is busy, station waits until next slot.
 If the channel is idle, it transmits the frame. It reduces the chance of collision and
improves the efficiency of the network.

CSMA with Collision Detection (CSMA/CD)


 In CSMA/CD, the station that sends its data on the channel continues to sense the
channel even after data transmission.
 If collision is detected, the station aborts its transmission and waits for a random
amount of time & sends its data again.
 As soon as a collision is detected, the transmitting stations release a jam signal.
 Jam signal alerts other stations. Stations are not supposed to transmit immediately
after the collision has occurred.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

CSMA with Collision Avoidance (CSMA/CA)


 This protocol is used in wireless networks because they cannot detect the collision.
 So, the only solution is collision avoidance.
 It avoids the collision by using three basic techniques:
1. Interframe Space - Whenever the channel is found idle, the station does not
transmit immediately. It waits for a period of time called Interframe Space
(IFS).
2. Contention Window - the station needs to sense the channel after each time
slot.
3. Acknowledgements - Positive acknowledgement and the time-out timer help
guarantee that the receiver has received the frame.

Controlled Access Protocol


 In the Controlled access technique, all stations need to consult with one another in order
to find out which station has the right to send the data.
 The controlled access protocols mainly grant permission to send only one node at a
time; thus in order to avoid the collisions among the shared mediums.
 No station can send the data unless it has been authorized by the other stations.
 The protocols lies under the category of Controlled access are as follows:
1. Reservation
2. Polling
3. Token Passing

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Reservation
 In this method, a station needs to make a reservation before sending the data.
 Time is mainly divided into intervals.
 Also, in each interval, a reservation frame precedes the data frame that is sent in that
interval.
 Suppose if there are 'N' stations in the system in that case there are exactly 'N'
reservation minislots in the reservation frame; where each minislot belongs to a
station.
 Whenever a station needs to send the data frame, then the station makes a
reservation in its own minislot.
 Then the stations that have made reservations can send their data after the
reservation frame.

Polling
 The polling protocol requires one of the nodes to be designated as Master node
(Primary Station).
 The mater node polls each of the nodes in a round-robin fashion.
 In particular, the master node first sends a message to node1, saying that it (node1) can
transmit up to some maximum number of frames.
 After node 1 transmits some frames, the master node tells node2 it (node 2) can
transmit up to the maximum number of frames.
 The master node can determine when a node has finished sending its frames by observing
the lack of a signal on the channel.
 The procedure continues in this manner, with the master node polling each of the
nodes in a cyclic manner.
 The polling protocol eliminates the collision.
Drawback
1. The protocol introduces a polling delay-the amount of time required to notify a
node that it can transmit.
2. If the master node fails, the entire channel becomes inoperative.

Choose one node as a master


node
Mater node polls each of the nodes in a round-robin fashion.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Token Passing
 A station is authorized to send data when it receives a special frame called a token.
 Here there is no master node.
 A small, special-purpose frame is known as a token is exchanged among the nodes in
some fixed order.
 When a node receives a token, it holds onto the token only if it has some frames to
transmit; otherwise it immediately forwards the token to the next node.
 If a node does have frames to transmit when it receives the token, it sends up to a
maximum number of frames and then forwards the token to the next node.
 Token passing is decentralized and highly efficient. But it has problems as well.
 For example, the failure of one node can crash the entire channel. Or if a node
accidentally neglects to release the token, then some recovery procedure must be invoked
to get the token back in circulation.

Channelization
 Channelization is a set of method that provides the multiple-access and, the available
bandwidth of the link is shared in time, frequency, or through the code in between the different
stations.
The three channelization methods are−
 Frequency division multiple access (FDMA)
 Time division multiple access (TDMA)
 Code division multiple access (CDMA)

Frequency division multiple access (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 sub-channel.
 Guard bands are also added so that no two bands overlap to avoid crosstalk and noise.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Advantages of FDMA
 This technique is efficient when the traffic is uniformly constant.
 In case if the channel is not in use then it sits idle.
 FDMA is simple algorithmically and the complexity is less.
 For FDMA there is no restriction regarding the type of baseband or the type of modulation.
Disadvantages of FDMA
 By using FDMA, the maximum flow rate per channel is fixed and small.

2. Time-Division Multiple Access


 With the help of this technique, the stations share the bandwidth of the channel in time.
 A time slot is allocated to each station during which it can send the data.
 Data is transmitted by each station in the assigned time slot.
 There is a problem in using TDMA and it is due to TDMA the synchronization cannot be achieved
between the different stations.
 When using the TDMA technique then each station needs to know the beginning of its slot and
the location of its slot.
 If the stations are spread over a large area, then there occur propagation delays; in order to
compensate this guard, times are used.
 The data link layer in each station mainly tells its physical layer to use the allocated time slot.

Some examples of TDMA are as follows;


 personal digital Cellular(PDC)
 Integrated digital enhanced network.
 Universal terrestrial radio access(UTRA)

3. Code-Division Multiple Access


 CDMA(code-division multiple access) is another technique used for channelization.
 CDMA technique differs from the FDMA because only one channel occupies the entire
bandwidth of the link.
 The CDMA technique differs from the TDMA because all the stations can send data
simultaneously as there is no timesharing.
 The CDMA technique simply means communication with different codes.
 In the CDMA technique, there is only one channel that carries all the transmission
simultaneously.
 CDMA is mainly based upon the coding theory; where each station is assigned a code, Code is a
sequence of numbers called chips.
 The data from the different stations can be transmitted simultaneously but using different code
languages.
Advantages of CDMA
 Provide high voice quality.
 CDMA operates at low power levels.
 The capacity of the system is higher than the TDMA and FDMA.
 CDMA is better cost-effective.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Switching Types of Swiching Techniques


 Switching in computer network
helps in deciding the best route for
data transmission if there are
multiple paths in a larger network.

 One-to-One connection (Sender to


Receiver)

Circuit Switching
 A dedicated path is established between the sender and receiver.
 Before data transfer, connection will be established first.
 Example: Telephone network.
 3 Phases in Circuit Switching:-
1. Connection establishment
2. Data transfer
3. Connection disconnection

Advantages
1. A well-defined and dedicated path exists for the data to travel.
2. There is no header overhead.
3. There is no waiting time at any switch and the data is transmitted without any delay.
4. Data always reaches the other end in order.
5. No re ordering is required.
Disadvantages
1. The channel is blocked for two ends only.
2. It is inefficient in terms of utilization of system resources.
3. The time required for establishing the circuit between the two ends is too long.
4. Dedicated channels require more bandwidth.
5. It is more expensive than other switching techniques.
6. Routing decisions cannot be changed once the circuit is established.

Packet Switching
 Message is broken into individual chunks called as packets.
 Each packet is sent individually.
 Each packet will have source and destination IP address with sequence number.
 Sequence numbers will help the receiver to

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

o Reorder the packets.


o Detect missing packets
o Send acknowledgments
Packet Switching – Datagram Approach
 Datagram Packet Switching is also known as Connectionless switching.
 Each independent entity is called as datagram.
 Datagrams contain destination information and the intermediary devices uses this
information to forward datagrams to right destination.
 The path is not fixed.
 Intermediate nodes take the routing decisions to forward the packets.

Packet Switching – Virtual Circuit Approach


 Virtual Circuit Switching is also known as connection-oriented switching.
 In the case of virtual circuit switching, a preplanned route is established before the
messages are sent.
 Call request and call accept packets are used to establish the connection between sender
and receiver.
 In this approach, the path is fixed for the duration of a logical connection.

Comparison of switching techniques

S.No Circuit Switching Datagram Packet Virtual Circuit Packet


1. Dedicated path No dedicated path Dedicated path
Path established for Route established for Route established for
2.
entire conversion each packet entire conversation
Packet transmission Call set up delay, Packet
3. Call set up delay
delay transmission delay
Overload may block call
Overload may block Overload increases
4. set up and increases
call set up packet delay
packet delay
5. No code conversion Code conversion Code conversion
6. Fixed bandwidth Dynamic bandwidth Dynamic bandwidth

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Introduction to IEEE Standard 802


 It stands for Institute of Electricals and Electronics Engineers.
 IEEE set standards for electrical and electronic equipment.
 Standard means level of quality.
 Below table shows IEEE standards

Standard Name Uses


Routing, Bridging and Network – to Network
802.1 Internetworking
Communications
802.2 Logical Link Control Error and flow control over data frames
802.3 Ethernet LAN All forms of Ethernet media and Interfaces
802.4 Token Bus LAN All forms of Token Bus media and interfaces
802.5 Token Ring LAN All forms of Token Ring media and interfaces
802.6 Metropolitan Area Network MAN Technologies, Addressing and Services
Broadband Technical Advisory
802.7 Broadband network and Interfaces
Group
Fiber Optic Technical Advisory Fiber Optic media used in token-passing Networks
802.8
Group like FDDI
Integration of voice and data traffic over a single
802.9 Integrated Voice/ Data Network
network medium
Network access controls, encryption, certification and
802.10 Network security
other security topics
Standards for wireless networking for many different
802.11 Wireless Networks
broadcast frequencies and usage techniques.
A variety of 100 Mbps-plus technologies including
802.12 High-Speed Networking
100 BASE-VG
Standards for designing network over coaxial cable
802.14 Cable Broadband LANs and MANs
based broadband connection
The coexistence of wireless personal area network
802.15 Wireless Personal Area Networks with others wireless devices in unlicensed frequency
bands
The atmospheric interface and related functions
802.16 Broadband Wireless Access
associated with Wireless Local Loop(WLL)

Ethernet (IEEE 802.3)


 It is defined under IEEE 802.3.
 One of the most widely used wired LAN technologies.
 It typically uses coaxial or UTP cable.
 Supports data bandwidths of 10, 100, 1000, 10000, 40000, and 100,000Mbps (100 Gbps).

Ethernet Standards
 The IEEE 802.3 standard defines Ethernet protocols for (Open Systems Interconnect) OSI’s Media
Access Control (MAC) sub layer and physical layer network characteristics.
 The IEEE 802.2 standard defines protocols for the Logical Link Control (LLC) sub layer.

Characteristics
1. Ethernet uses bus topology. In bus topology, all the stations are connected to a single half duplex link.
2. Ethernet uses CSMA / CD as access control method to deal with the collisions.
3. Ethernet uses Manchester Encoding Technique for converting data bits into signals.

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

4. Ethernet evolution
o For Normal Ethernet, operational bandwidth is 10
Mbps.
o For Fast Ethernet, operational bandwidth is 100
Mbps.
o For Gigabit Ethernet, operational bandwidth is 1
Gbps.
o For Ten-Gigabit Ethernet, operational bandwidth is
10Gbps.
Ethernet Frame Format

1. Preamble
 It is a 7 byte field that contains a pattern of alternating 0’s and 1’s.
 It alerts the stations that a frame is going to start.
 It also enables the sender and receiver to establish bit synchronization.
2. Start Frame Delimiter (SFD)
 It is a 1 byte field which is always set to 10101011.
 The last two bits “11” indicate the end of Start Frame Delimiter and marks the beginning of the
frame.
3. Destination Address
It is a 6 byte field that contains the MAC address of the destination for which the data is
destined.
4. Source Address
It is a 6 byte field that contains the MAC address of the source which is sending the data.
5. Length
 It is a 2 byte field which specifies the length (number of bytes) of the data field.
 This field is required because Ethernet uses variable sized frames.
6. Data
 It is a variable length field which contains the actual data.
 It is also called as a payload field.
 The length of this field lies in the range [ 46 bytes , 1500 bytes ].
 Thus, in a Ethernet frame, minimum data has to be 46 bytes and maximum data can be 1500
bytes.
7. Frame Check Sequence (CRC)
It is a 4 byte field that contains the CRC code for error detection.

Minimum and maximum lengths

Frame Length
Minimum: 64 bytes (512 bits)
Maximum: 1518 bytes (12144 bits)

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

Ethernet Address
Example in hexadecimal notation

Unicast and multicast addresses

The least significant bit of the first byte defines the type of address.
 If the bit is 0, the address is unicast; otherwise, it is multicast.
 If all bits are 1, then it is broadcast address.

Example 1
Define the type of the following destination addresses:
a. 4A:30:10:21:10:1A b. 47:20:1B:2E:08:EE c. FF:FF:FF:FF:FF:FF
Solution
(a) 4A => 0100 1010 => 0100 1010 => Unicast Address
(b) 47 => 0100 0111 => 0100 0111 => Multicast Address
(c) FF => 1111 1111 => all are 1’s => Broad cast Address

Example 2
Show how the address 47:20:1B:2E:08:EE is sent out on line.
Solution
The address is sent left-to-right, byte by byte; for each byte, it is sent right-to-left (sent out on
line (ie) chennal, bit by bit, as shown below:

Categories of Standard Ethernet

 The most commonly installed Ethernet systems are called 10BASE-T, which provides
transmission speeds up to 10 Mbps.
 'Fast Ethernet' or 100BASE-T provides transmission speeds up to 100 megabits per second and is
typically used for servers, LAN backbone systems and in workstations with high-bandwidth
needs.
 Gigabit Ethernet provides an even faster level of backbone support at 1000 megabits per second (1
gigabit or 1 billion bits per second).
Advantages
1. It is simple to understand and implement.
2. Its maintenance is easy.
3. It is cheap.

************

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

CN Question Bank
Part – A

1. What are the drawbacks of Longitudinal Redundancy Check with example?


2. Use checksum method, suppose that the sender wants to send 3 frames each of 7 bits,
where the frames are 1000111, 0011110 and 1011101, whether given frames is accepted or
not?
3. What is Statistical TDM?
4. What is Multiplexing?
5. Define error control.
6. Briefly discuss stop-and-wait method of flow control.
7. List the two forms in which virtual circuit packet switching is implemented.
8. Assuming a framing protocol that uses bit stuffing, show the bit sequence transmitted over
a link when the frame contains the bit sequence 1111011111101001111101011111110.
Mark the stuffed bit.
9. Give the structure of encoder and decoder in error correction.
10. Define flow control.
11. Briefly describe two advantages of using packet switching for data transmission.
12. If the bit string 0111001111101111100 has to be transmitted in the data link layer, what is
the actual String that has to be transmitted after bit stuffing assumes flag as 0111110?
13. What is the necessity of flow control?
14. Mention the advantages of cyclic codes.
15. Differentiate between virtual circuit and Datagram in packet switching
16. Define Circuit Switched Network
17. What do you mean by Automatic Repeat Request (ARQ)?
18. Differentiate between Virtual circuit and Datagram circuits.
19. What is even parity give one example?
20. What is a Redundancy bit?
21. Write about piggybacking
22. What is virtual circuit network?
23. What are the techniques of Controlled Access?
24. Define party bit.
25. Explain different framing methodologies.
26. What is CSMA?
27. What is ALOHA?
28. What is parity bit and types of parity bits?

Part - B

1. Describe two approaches by which packet loss is detected in a Go back – N ARQ protocol
and Selective Repeat Request.
2. Explain about pure ALOHA and slotted ALOHA with example.
3. What is framing and Explain about bit stuffing and byte stuffing in detail with example
4. Explain different Multiplexing techniques?
5. Explain the MAC sub layer in detail with suitable frame design.
6. Write about various CSMA techniques in detail?
7. What is error detection? Use error detection method CRC on the given message as
1101011011 and the generator polynomial is X4+X+1 and find the actual data to be

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 2 Computer Networks

transmitted?
8. Explain about Framing and its types.
9. What kinds of errors can Vertical Redundancy check determine? What kinds of errors it
cannot determine?
10. Explain the working of Carrier Sense Multiple Access Protocol.
11. Explain the frame format of IEEE 802.3.
12. A 7 bit hamming code is received as 1011011.Assume even parity and state whether
received data correct or not, if it is corrupted locate the bit.
13. Write about various channelization techniques in details?
14. What is CSMA/CD Explain?
15. With an example, illustrate how CRC encoder and decoder will work.
16. Explain CRC technique in detail.
17. Compare and contrast Go-Back – N ARQ protocol with Selective Repeat Request.
18. Discuss stop and wait protocol.
19. Discuss sliding window protocol using Go-Back.
20. Explain various types of error detection methods?
21. Explain byte stuffing and bit stuffing.
22. Explain any two error detection mechanisms in-detail.
23. Explain the following:
a) Reservation
b) Token passing
c) Polling

****************

RADHAKRISHNAN.P, Assistant Professor Department of CS & AI, SR University


Unit - 3 Computer Networks

Unit III
Network Layer
Logical Addressing-IPv4 addressing, IPv6 Addressing. IPv4 and IPv6 Packet formats, Transmission
from IPv4 to IPv6, Address mapping, ICMP,IGMP , Unicast Routing Algorithms ,Multicast Routing
Algorithms .
Physical Address
➢ A network device has a unique and parmanent physical address.
➢ It should be hardware level address.
➢ Address printed on the NIC installed in motherboard
➢ It also called MAC address

Logical address
➢ The hosts and routers are recongnized at the network level by their logical address.
➢ Logical address is unique universal.
➢ A logical address also called IP address.

IP address
➢ IP Address is short for Internet Protocol Address.
➢ It is a unique address assigned to each computing device in an IP network.
➢ ISP assigns IP Address to all the devices present on its network.
Types Of IP Address
1. Static IP Address-
➢ Static IP Address is an IP Address that once assigned to a network element always remains
the same.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

➢ They are configured manually.


➢ Static IP Addresses are more costly than dynamic IP Addresses.
2. Dynamic IP Address-
➢ Dynamic IP Address is a temporarily assigned IP Address to a network element.
➢ It can be assigned to a different device if it is not in use.
➢ DHCP or PPPoE assigns dynamic IP addresses.
IP Address Format-
➢ IP Address is a 32 bit binary address written as 4 bytes separated by dots.
➢ The 4 bytes are called as octets where each octet has 8 bits.
➢ The octets are divided into 2 components- Net ID and Host ID.

Network ID It is used to identify the network.


Host ID It is used to identify the host within the network.
IP Addressing-

Classful Addressing System


IP addresses use the concept of classful addressing which splits the available address space into five classes A,
B, C, D & E.

Class A
➢ Used for larger organization
➢ The first 8 bits are used for the Network ID.
➢ The remaining 24 bits are used for the Host ID.
➢ Ranges : 1.0.0.1 to 126.255.255.254
Class B
➢ Used for medium size organization
➢ The first 16 bits are used for the Network ID.
➢ The remaining 16 bits are used for the Host ID.
➢ Ranges : 128.0.0.1 to 191.255.255.254
Class C
➢ Used for home PC’s

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

➢ The first 24 bits are used for the Network ID.


➢ The remaining 8 bits are used for the Host ID.
➢ Ranges : 192.0.0.1 – 223.255.255.254
Class D
➢ Used for multicast purpose
➢ Class D is not divided into Network ID and Host ID.
➢ Ranges : 224.0.0.1 – 239.255.255.254
Class E
➢ Used for Research and Military purpose
➢ Class E is not divided into Network ID and Host ID.
➢ Ranges : 240.0.0.1 – 254.255.255.254
Overview of Classes of IPv4 Address

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.
o Classless Addressing is an improved IP Addressing system.
o It makes the allocation of IP Addresses more efficient.
o It replaces the older classful addressing system based on classes.
o It is also known as Classless Inter Domain Routing (CIDR).
CIDR Block-
o When a user asks for specific number of IP Addresses,
o CIDR dynamically assigns a block of IP Addresses based on certain rules.
o This block contains the required number of IP Addresses as demanded by the user.
o This block of IP Addresses is called as a CIDR block.
***************

2versions of IP addresses
1 IPv4 (32 – bit Address)
2 IPv6 (128 – bit Address)

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Internet Protocol Version 4


➢ IPv4 address is 32 bit long.
➢ The IPv4 addresses are unique and universal.
➢ IPv4 short for Internet Protocol Version 4 is the fourth version of the Internet Protocol (IP).
➢ IP is responsible to deliver data packets from the source host to the destination host.
➢ This delivery is completely based on the IP Addresses in the packet headers.
➢ IPv4 is the first major version of IP.
➢ The address space of IPv4 is 232 or 4,294,967,296.

Dotted-decimal notation and binary notation for an IPv4 address


➢ 32 bits are broken in to 4 octets (1 octet= bits) and converted in to decimals.
➢ The value of each Octet ranges from 0 to 255 in decimal or 00000000 to 11111111 to binary
Types of IPv4
1. Unicast address
➢ It represents the transmission when data is transmitted to only one direction.
➢ Example: 10.0.0.1
2. Multicast address
➢ It represents the transmission when data is transmitted to group of destination.
➢ Example: 224.179.20.10
3. Broadcast address
➢ It represents the transmission when data is transmitted to all the destination direction.
➢ Example: 255.255.255.255
Subnetting
➢ Subnet is an logical subdivision of an IP network
➢ The process of dividing a single network into multiple sub networks is called as subnetting.
➢ The sub networks so created are called as subnets.
➢ Subnet mask is a 32-bit number used to identify the network portion and the host portion in the IP
address
Example-
Following diagram shows the subnetting of a big single network into 4 smaller subnets-

Default masks for classful addressing

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Advantages-
The two main advantages of subnetting a network are-
➢ It improves the security.
➢ The maintenance and administration of subnets is easy.
➢ Minimizes Broadcasting
➢ Maximizes Network Performance
Subnet ID
➢ Each subnet has its unique network address known as its Subnet ID.
➢ The subnet ID is created by borrowing some bits from the Host ID part of the IP Address.
➢ The number of bits borrowed depends on the number of subnets created.
Types of Subnetting-
Subnetting of a network may be carried out in the following two ways-

1. Fixed Length Subnetting-


Fixed length subnetting also called as classful subnetting divides the network into subnets where-
➢ All the subnets are of same size.
➢ All the subnets have equal number of hosts.
➢ All the subnets have same subnet mask.
2. Variable Length Subnetting-
Variable length subnetting also called as classless subnetting divides the network into subnets where-
➢ All the subnets are not of same size.
➢ All the subnets do not have equal number of hosts.
➢ All the subnets do not have same subnet mask.
IPv4 Header Format
➢ Internet Protocol being a layer-3 protocol (OSI) takes data Segments from layer-4 (Transport) and
divides it into packets.
➢ IP packet encapsulates data unit received from above layer and add to its own header information.

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

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

1. Version-
➢ Version is a 4 bit field that indicates the IP version used.
➢ The most popularly used IP versions are version-4 (IPv4) and version-6 (IPv6).
➢ Only IPv4 uses the above header.
2. Header Length-
➢ Header length is a 4 bit field that contains the length of the IP header.
➢ It helps in knowing from where the actual data begins.
Minimum Header Length- 20 bytes
Maximum Header Length- 60 bytes
3. Type Of Service
➢ Type of service is a 8 bit field that is used for Quality of Service (QoS).
➢ The datagram is marked for giving a certain treatment using this field.
➢ Type of Service is also called Differentiated Services Code Point or DSCP.
➢ This field is provided features related to the quality of service for data streaming or VoIP calls.
➢ The first 3 bits are the priority bits. It is also used for specifying how you can handle Datagram.
➢ ECN − Explicit Congestion Notification; It carries information about the congestion seen in the route.
4. Total Length (Packet Length)
➢ This field specifies the total length of the packet (16-bit).
➢ This length includes the length of the header and the length of the payload. (Packet Length
=Header+Data)
➢ By subtracting the header length from the total length packet, routers can calculate the length of
the payload. (Length of payload(Data)= total length of packet – header length)
➢ Since a 16 bits field cannot store a value more than 65535, the maximum length of an IP packet can be
65535 bytes.
5. Identification − If IP packet is fragmented during the transmission, all the fragments contain same
identification number.

6. IP Flags
➢ These 3 bits are used for fragmentation
➢ The first bit is always set to 0.
➢ The second bit is called the DF (Don’t Fragment) bit and indicates that this packet should not
be fragmented.
➢ The third bit is called the MF (More Fragments) bit and is set on all fragmented packets
except the last one.
7. Fragment Offset
➢ 13 bits fields
➢ It specifies the location of a fragment in a packet.
8. Time To Live
➢ To avoid looping in the network, every datagram is sent with some TTL value set, which tells the
network how many routers (hops) this datagram can cross.
➢ At each routers (hops), its value is decremented by one and when the value reaches zero before
reaching the destination, then datagram is discarded.
9. 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, IGMP is 2,TCP is 6 , UDP is 17 and OSPF is 89.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

10. Header Checksum-.


➢ It contains the checksum value of the entire header.( 16 bit )
➢ The checksum value is used for error checking of the header.
11. Source Address
➢ 32-bit address of the Sender (or source) of the packet.
12. Destination Address
➢ 32-bit address of the Receiver (or destination) of the packet.
13. Options
➢ This is optional field, which is used if the value of IHL (Internet Header Length) is greater than 5.
➢ It contains values and settings related with security, record route and time stamp, etc.

IPv6 Address
➢ IPv6 is a 128 bit address
➢ It is represented in Hexadecimal Format
➢ It is separated by colon (:)
➢ It is composed of 8 Hex blocks
➢ Each Hex Blocks will have 16 Bits. (Total of 8 * 16 = 128 Bits)
➢ It has a fixed value representation of Subnet mask /64
Types of IPV6 addresses:
This IPV6 address format categorised into three types
1. Unicast address (one to one) : This address is assigned to only single interface. Therefore, unicast
address is classified into three classes; they are Global unicast, Link local, Unique local.
2. Anycast address (one to closest node) : An address for multiple interfaces on different nodes
3. Multicast address (one to many) : Multicast behaves in same way in IPV4 and IPv6. It works as a
group interfaces on different nodes.
Example
IPv6 Address = 128 Bits (Hexadecimal)

Case 1
If a block has all 0’s, you can write a single 0 to represent the block.
Example

Case 2
If you have leading 0’s in a block, you can omit the leading 0’s .
Example

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Case 3
If you have continuous blocks of 0’s, you can represent them using a “ :: “ .
This form of representation can be used only once in the IP Address.
Example

IPv6 Packet Format


The IPv6 protocol defines a set of headers, including the basic IPv6 header and the IPv6 extension headers.

The following list describes the function of each header field.


1. Version:
➢ It is a 4-bit field.
➢ It represents version IPV6 in binary 0110(6).
2. Traffic Class:
➢ It is 8-bits filed which also known as priority.
➢ These 8 bits are divided into two parts.
➢ The most significant 6 bits are used for Type of Service.
➢ It replaces IPv4’s ‘type of service’ field.
➢ Its basic purpose is to provide quality of service (QoS).
➢ The least significant 2 bits handles the packets in Congestion (i.e. loop).
➢ Instead of dropping packets, last 2-bits use Explicit Congestion Notification (ECN) to handle the
packets.
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
➢ It is 16-bits field.
➢ It tells the routers about the size of payload which belongs to a particular packet.
➢ With 16 bits, up to 65535 bytes can be indicated of data.
5. Next Header:
➢ It is 8-bits field.
➢ It tells the type of Extension Header which are additionally used with base header to send more data
or information’s.
➢ If extension header is used along with payload, then corresponding bits value is presented in this
filed.
➢ It mean if Routing header is used as extension header then 43(in bits) is represented in Next header
(8bit) field.
Note: Extension headers are optional, and are used if needed.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

➢ Some extension headers are given below

6. Hop Limit:
➢ It is 8-bits field.
➢ This field is used to stop packet to loop in the network infinitely.
➢ This is same as TTL in IPv4.
➢ The Hop-Limit field value is decremented by 1 as it passes a link (i.e. router). When the value of Hop-
limit 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.

Difference Between IPv4 and IPv6


IPv4 IPv6
Address Size 32 Bit 128 Bit
Representation Decimal Hexadecimal
Writing Format
Doesn’t support auto
Configuration Support auto configuration
configuration
Security No security in network layer It provide security
Class A - /8
Default Subnet mask Class B - /16 Fixed Mask - /64
Class C - /24

Example for Address

Transmission from IPv4 to IPv6


➢ In the current scenario, the IPv4 address is exhausted and IPv6 had come to overcome the limit.
➢ Various organizations are currently working with IPv4 technology and in one day we can’t switch
directly from IPv4 to IPv6.
➢ Instead of only using IPv6, we use combination of both and transition means not replacing IPv4 but
co-existing of both.
➢ When we want to send a request from an IPv4 address to an IPv6 address, but it isn’t possible
because IPv4 and IPv6 transition is not compatible.
➢ For a solution to this problem, we use some technologies. These technologies are Dual Stack
Routers, Tunneling, and NAT Protocol Translation.
Dual-Stack Router
➢ In dual-stack router, A router’s interface is attached with IPv4 and IPv6 addresses configured are
used in order to transition from IPv4 to IPv6.
➢ In this below diagram, A given server with both IPv4 and IPv6 addresses configured can
communicate with all hosts of IPv4 and IPv6 via dual-stack router (DSR).
➢ The dual stack router (DSR) gives the path for all the hosts to communicate with the server
without changing their IP addresses.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Tunneling
➢ When two computers using IPv6 want to communicate with each other and the packet must pass
through a region that uses IPv4.
➢ The IPv6 packet it encapsulated in an IPv4 packet when it enters the region, and it leaves its
capsulate when it exits the region.

Header Translation
➢ IPv4 to IPv6 migration strategies is also called as NAT-PT (Network Address Translation – Protocol
Translation).
➢ It is used when some of the system uses IPv4, the sender wants to use IPv6, but the receiver does
not understand IPv6.
➢ The header format must be totally changed through header translation. The header of the IPv6
packet is converted to an IPv4 header and vice versa.

Address Mapping
➢ The delivery of a packet to a host or a router requires two levels of addressing: logical and
physical.
➢ We need to be able to map a logical address to its corresponding physical address and vice versa.
➢ This can be done by using either static or dynamic mapping.
Static mapping:
In static mapping, it creates a table that contains a logical address with a physical address.
Dynamic mapping:
➢ When a machine knows one of two addresses (logical or physical) through dynamic mapping,
it may use this protocol to find the other one address.
➢ There are designed two protocols for done dynamic mapping.
• Address Resolution Protocol (ARP)
• Reverse Address Resolution Protocol (RARP)
Address Resolution Protocol (ARP)
➢ It is a dynamic mapping protocol that is used to find out the physical address associated with the
logical address.
➢ The working of ARP is shown below in the figure.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

❖ Firstly, the client broadcasts the ARP request packet to all the hosts in the network.
❖ In this ARP request packet, stores the logical address and physical address of the client and the IP
address of the receiver.
❖ Each host receives this ARP request packet, but only the one who is the authorized host response to
the ARP request service.
❖ Finally, the authorized host sends the ARP response packet to the client in which its physical
address is stored.
Note: ARP request is broadcast, and ARP response is unicast.

Reverse Address Resolution Protocol (RARP)


➢ It is a dynamic mapping protocol that is the opposite of ARP.
➢ It is used to find out the logical address of the machine associated with the physical address.
➢ The working of RARP is shown below in the figure.

❖ Firstly, the client broadcasts the RARP request packet to all the hosts in the network.
❖ The physical address of the client is stored in this RARP request packet.
❖ Each host receives this RARP request packet, but only the one who is the authorized host response to
the RARP service. This authorized host is called the RARP server.
❖ RARP server sends the RARP response packet to the client in which its logical address is stored.
RARP is not used nowadays, it was replaced by BOOTP (Bootstrap Protocol), and now BOOTP has been
replaced by DHCP (Dynamic Host Configuration Protocol).

BOOTP
➢ BOOTP stands for Bootstrap Protocol.
➢ It is a computer networking protocol that is used to assign IP addresses to network devices in a
network.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

➢ In other words, it is an internet protocol that is used by the client to obtain the IP address from the
server.
➢ It was defined in RFC 951 and 1084.
➢ It was designed to replace RARP (Resource Address Resolution Protocol).


Working of BOOTP
➢ When the Bootstrap protocol started by the client, it does not have an IP address.
➢ Therefore, it broadcasts a message in the network, and Its MAC address is inside this message.
➢ This message is called "BOOTP request," and takes this request by the BOOTP server.
➢ The server then provides the following information in reply to the client.
❖ It provides the IP address, subnet mask, and gateway address of the client.
❖ It also provides the IP address and hostname of the server.
DHCP
➢ DHCP stands for Dynamic Host Configuration Protocol.
➢ It is designed to provide the static and dynamic address allocation that can be done manual or
automatic.
➢ It was designed to replace the BOOTP (Bootstrap Protocol).

ICMP
➢ ICMP stands for Internet Control Message Protocol.
➢ ICMP handles both control and error messages, but its main function is to report the error but not to
correct them.
➢ An IP datagram contains the addresses of both source and destination, but it does not know the address
of the previous router through which it has been passed. Due to this reason, ICMP can only send the
messages to the source, but not to the immediate routers.
➢ ICMP protocol communicates the error messages to the sender. ICMP messages cause the
errors to be returned back to the user processes.
➢ ICMP messages are transmitted within IP datagram.
The Format of an ICMP message

➢ The first field specifies the type of the message.


➢ The second field specifies the reason for a particular message type.
➢ The checksum field covers the entire ICMP message.
Error Reporting
➢ ICMP protocol reports the error messages to the sender.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Five types of errors reporting are handled by the ICMP protocol:

➢ Destination unreachable:
o The message of "Destination Unreachable" is sent from receiver to the sender when destination
cannot be reached, or packet is discarded when the destination is not reachable.
➢ Source Quench:
o The purpose of the source quench message is congestion control.
o The message sent from the congested router to the source host to reduce the transmission rate.
o ICMP will take the IP of the discarded packet and then add the source quench message to the IP
datagram to inform the source host to reduce its transmission rate.
o The source host will reduce the transmission rate so that the router will be free from congestion.
➢ Time Exceeded:
o Time Exceeded is also known as "Time-To-Live". It is a parameter that defines how long a
packet should live before it would be discarded.
There are two ways when Time Exceeded message can be generated:
❖ Sometimes packet discarded due to some bad routing implementation, and this causes
the looping issue and network congestion.
❖ Due to the looping issue, the value of TTL keeps on decrementing, and when it reaches
zero, the router discards the datagram.
❖ However, when the datagram is discarded by the router, the time exceeded message
will be sent by the router to the source host.
❖ When destination host does not receive all the fragments in a certain time limit, then the
received fragments are also discarded, and the destination host sends time Exceeded
message to the source host.
➢ Parameter problems:
o When a router or host discovers any missing value in the IP datagram, the router discards the
datagram, and the "parameter problem" message is sent back to the source host.
➢ Redirection:
o Redirection message is generated when host consists of a small routing table.
o When the host consists of a limited number of entries due to which it sends the datagram to a
wrong router.
o The router that receives a datagram will forward a datagram to a correct router and also sends
the "Redirection message" to the host to update its routing table.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

IGMP
➢ IGMP stands for Internet Group Message Protocol.
➢ The IP protocol supports two types of communication:
o Unicasting: It is a communication between one sender and one receiver. Therefore, we can say
that it is one-to-one communication.
o Multicasting: Sometimes the sender wants to send the same message to a large number of
receivers simultaneously. This process is known as multicasting which has one-to-many
communication.
➢ The IGMP protocol is used by the hosts and router to support multicasting.
➢ The IGMP protocol is used by the hosts and router to identify the hosts in a LAN that are the
members of a group.

➢ IGMP is a part of the IP layer, and IGMP has a fixed-size message.


➢ The IGMP message is encapsulated within an IP datagram.

The Format of IGMP message

Where,
Type: It determines the type of IGMP message. There are three types of IGMP message: Membership Query,
Membership Report and Leave Report.
Maximum Response Time: This field is used only by the Membership Query message. It determines the
maximum time the host can send the Membership Report message in response to the Membership Query
message.

Checksum: It determines the entire payload of the IP datagram in which IGMP message is encapsulated.
IGMP Messages

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

o Membership Query message


➢ This message is sent by a router to all hosts on a local area network to determine the set of
all the multicast groups that have been joined by the host.
➢ It also determines whether a specific multicast group has been joined by the hosts on an
attached interface.

o Membership Report message


➢ The host responds to the membership query message with a membership report message.
➢ Membership report messages can also be generated by the host when a host wants to join the
multicast group without waiting for a membership query message from the router.
➢ Membership report messages are received by a router as well as all the hosts on an attached
interface.
➢ Each membership report message includes the multicast address of a single group that the
host wants to join.
➢ IGMP protocol does not care which host has joined the group or how many hosts are
present in a single group. It only cares whether one or more attached hosts belong to a
single multicast group.
➢ The membership Query message sent by a router also includes a "Maximum Response time".
After receiving a membership query message and before sending the membership report
message, the host waits for the random amount of time from 0 to the maximum response time.
If a host observes that some other attached host has sent the "Maximum Report message",
then it discards its "Maximum Report message" as it knows that the attached router already
knows that one or more hosts have joined a single multicast group. This process is known as
feedback suppression. It provides the performance optimization, thus avoiding the unnecessary
transmission of a "Membership Report message".
o Leave Report
➢ When the host does not send the "Membership Report message", it means that the host has
left the group. The host knows that there are no members in the group, so even when it
receives the next query, it would not report the group.
**************
Routing
➢ An internet is a combination of networks connected by routers.
➢ Routing is a process of selecting paths in a network
➢ When a datagram goes from a source to a destination, it will probably pass through many
routers until it reaches the router attached to the destination network.
➢ Host or routers have routing table.
Static Routing table
➢ Information in routing table is entered manually by the administrator.
➢ Changes in the internet are also updated manually.
➢ It is used in small internet or in an experimental internet.
Dynamic Routing table
➢ Information in routing table is updated automatically by protocols like RIP, OSPF or BGP.
➢ Changes in the internet are also updated automatically and periodically.
➢ It is used in big internet which can’t be managed manually.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Unicast Routing Protocol


➢ In unicast routing there is one source and one destination.
➢ The router refers to the routing table.
➢ If the packet’s destination is not found then the packet is discarded.
➢ If the packet’s destination is found then an optimal path is selected.
➢ The router then forwards the packet through one port which leads to the optimal path.
Optimization
➢ It depends on the metric
➢ Metric: a cost assigned for passing through a network
➢ A router should choose the route with the smallest metric (minimum cost)
Autonomous System (AS)
➢ Autonomous System (AS) consists of group of networks and routers under the authority of single
administration.
➢ Large number of hosts and routers are connected to the internet.One routing protocol cannot
update all routing tables in the internet.
➢ So the internet is divided into autonomous systems.

Interior and Exterior Routing


➢ Routing inside the AS is called interior routing (RIP and OSPF)
➢ Routing outside the AS is called exterior routing (BGP)

Distance-vector routing algorithm (RIP)


➢ Classical Distributed Bellman-Ford algorithm
➢ RIP (Routing Information Protocol)
➢ In distance vector routing, the least cost route between any two nodes is the route with minimum
distance.
➢ In this protocol each node maintains a vector (table) of minimum distances to every node
Example
In this example, is a network consisting of four
routers A, B, C, and D. The weights are shown in
the edges. And the weights could be distances or
costs or delays.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Neighbouring Nodes
A -> B,C,D
B -> A,C
C -> A,B,D
D -> A,C
Step 1:
Every router prepares its routing table using its information. Every table of the router is shown below.
At Router A At Router B

Destination Distance Next Hop Destination Distance Next Hop


A 0 A A 2 A
B 2 B B 0 B
C 8 C C 5 C
D 1 D D Infinite -

At Router C At Router D

Destination Distance Next Hop Destination Distance Next Hop


A 8 A A 1 A
B 5 B B Infinite -
C 0 C C 3 C
D 3 D D 0 D

Step 2:
➢ Every router shares its distance vector with its neighbours obtained in Step-01.
➢ Every router prepares a new routing table after exchanging of distance vectors.

At Router A new table:


At Router A
Destination Distance Next Hop
A 0 A
B 2 B
C 4 D
D 1 D

At Router B new table:


At Router B
Destination Distance Next Hop
A 2 A
B 0 B
C 5 C
D 3 A

At Router C new table:


At Router C
Destination Distance Next Hop
A 4 D
B 5 B
C 0 C
D 3 A

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

At Router D new table:


At Router D
Destination Distance Next Hop
A 1 A
B 3 A
C 3 C
D 0 D

Repeat the following steps for each advertised destination


If (destination not in the routing table)
Add the advertised information to the table
Else
If (next-hop field is the same)
Replace retry in the table with the new advertised one
Else
If (advertised hop count smaller than one in the table) Replace entry in the routing table
*********

Link State Routing (OSPF)


➢ Dijkstra's algorithm or Shortest-path-first protocols are another name for Link State protocols.
➢ OSPF (Open Shortest Path First)
➢ Link state routing is a technique in which each router shares the knowledge of its neighbourhood
with every other router in the internetwork.
➢ Each router with link state routing creates three separate tables. One table stores information about
directly connected neighbours, another stores the topology of the entire internetwork, and the third
stores the actual routing table.
➢ All routers in the network receive information about directly connected links via link state protocols.

The three keys to understand the Link State Routing algorithm:


o Knowledge about the neighbourhood: Instead of sending its routing table, a router sends the
information about its neighbourhood only. A router broadcast its identities and cost of the directly
attached links to other routers.
o Flooding: Each router sends the information to every other router on the internetwork . This
process is known as Flooding. Every router that receives the packet sends the copies to all its
neighbours. Finally, each and every router receives a copy of the same information.
o Information sharing: A router sends the information to every other router only when the change
occurs in the information.

Two Phases of Link State Routing


a. Reliable Flooding:
➢ Initial State: Each node is aware of the costs of its neighbours.
➢ Final state: Each node has a complete understanding of the graph.
b. Route Calculation:
➢ Dijkstra’s algorithm, also known as the Link state routing algorithm, finds the shortest path
from one node to all other nodes in the network.
➢ The Dijkstra’s algorithm is iterative, and it has the property that after k iterations, the least cost
paths for k destination nodes are well known.

Update D(v) for all v adjacent to w and not in N:


D(v) = min(D(v) , D(w) + c(w,v))

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Example
Given Problem Solution

Routing table for node A Shortest Path

****************
Path Vector Protocol (BGP)
➢ It is an Open Standard protocol.
➢ Path vector protocol use BGP (Border Gateway Protocol).
➢ BGP is an exterior routing protocol
➢ It designed for larger inter-network.
➢ It is Slowest Routing protocol in the world.
➢ BGP Neighbour router is also known as BGP Peer.
➢ It is the only routing protocl to use TCP
➢ TCP Connection is formed with the manually defined neighbour using TCP port 179.
➢ TCP is used for retransmitting the lost data, to avoid duplicate data, check summing(accurate
transmission)
➢ Each entry in the routing table contains the destination network, the next router and the path to
reach the destination.
Autonomous System Boundary Routers (ASBR)
➢ In BGP, the Autonomous System Boundary Routers (ASBR) sends path-vector messages to
advertise the reachability of networks.
➢ Each router that receives a path vector message must verify the advertised path according to its
policy.
➢ If the message complies with its policy, the router modifies its routing table and the message
before sending the message to the next neighbour.
➢ It modifies the routing table to maintain the autonomous systems that are traversed in order to
reach the destination system.
➢ It modifies the message to add it’s AS number and to replace the next router entry with its
identification.
Path Vector Protocol

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Loop Prevention :
Whenever a router sees its own AS number in the router update, it will drop and ignore it.

Initial routing tables in path vector routing


➢ It assumes that there is one node in each autonomous system that acts on behalf of the entire
autonomous system which is called as Speaker node.
➢ The speaker node in an AS creates a routing table and advertises to the speaker node in the
neighbouring AS`s
Initial routing tables in path vector routing

➢ A speaker in an autonomous system shares its table with immediate neighbours, here Node A1 share its
table with nodes B1 and C1 , Node C1 share its table with nodes A1,B1 and D1 , Node B1 share its
table with nodes A1 and C1 , Node D1 share its table with node C1 .
➢ If router A1 receives a packet for nodes A3, it knows that the path is in AS1, but if it receives a packet
for D1, it knows that the packet should go from AS1 to AS2 and then to AS3, then the routing table
shows that path completely on the other hand if the node D1 in AS4 receives a packet for node A2, it
knows it should go through AS4, AS3, and AS1.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

External BGP or eBGP or EGP


❖ External Gateway Protocol (EGP) used to route the information between different Autonomous
System.

Internal BGP or iBGP or IGP


❖ Internal Gateway Protocol (IGP) used to route the information within a same Autonomous System.

***************
Multicast Routing
➢ In multicasting, the router may forward the received packet through several of its interfaces.
(Or) A multicast packet may have destinations in more than one network.
➢ Forwarding of a single packet to members of a group requires a shortest path tree.
➢ If we have ‘n’ groups, we may need ‘n’ shortest path trees.

Multiple Unicasting
➢ Emulation of multicasting through multiple unicasting is not efficient and may create long delays,
particularly with a large group.

➢ Two approaches have been used to solve the problem


1. Source – Based Trees
2. Group – Shared Trees

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Source-Based Tree
➢ In the source-based tree approach, each router needs to have one shortest path tree for each group.

Group-Shared Tree
In the group-shared tree approach, only the core router, which has a shortest path tree for each group, is
involved in multicasting.

1. DVMRP
➢ The Distance Vector Multicast Routing Protocol is multicast routing protocol that takes the routing
decision based upon the source address of the packet.
➢ This algorithm constructs the routing tree for a network.
➢ Whenever a router receives a packet, it forwards it to some of its ports based on the source
address of packet.
➢ The rest of the routing tree is made by downstream routers.
➢ In this way, routing tree is created from destination to source.
➢ The protocol must achieve the following tasks:
1. It must prevent the formation of loops in the network.
2. It must prevent the formation of duplicate packets.
3. It must ensure that the path travelled by a packet is the shortest from its source to the
router.
4. It should provide dynamic membership.
➢ To accomplish this, the DVMR algorithm uses a process based on following decision making
strategies:
1. Flooding
2. Reverse Path Forwarding (RPF)
3. Reverse Path Broadcasting (RPB)
4. Reverse Path Multicasting (RPM)

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

1. Flooding
➢ Flooding broadcasts packets, but creates loops in the systems.
2. Reverse Path Forwarding (RPF)
➢ In this strategy, the router only forwards those packets that have travelled the shortest path from
source to destination.
➢ To achieve this, the router pretends that it has a packet to send to the source from where the
packet has arrived.
➢ In this way, the shortest path to the sender of the packet is computed.
➢ If the same route is followed by the received packet, it is forwarded to the next router and it is
discarded otherwise.
➢ The reverse path forwarding ensures that the network receives a copy of the packet without formation
of loops. A loop occurs when a packet that has left the router may come back again from another
interface or the same interface and be forwarded again.
➢ RPF does not guarantee that there would be no duplicate packets in the network i.e. the network
may receive two or more copies.
➢ The reason for this is that the routing is based on the source address and not on the destination address.
Problem With RPF

3. Reverse Path Broadcasting (RPB)


➢ RPB creates a shortest path broadcast tree from the source to each destination.
➢ It guarantees that each destination receives one and only one copy of the packet.
➢ In order to solve the problem, RPB is used.
1. In this method, one parent router is defined for each network.
2. The network could accept the multicast packets from this parent router only.
3. This router sends packets to those ports for which it is designated as parent.
4. Thus, RPB principle’ allows a router to broadcast the packet in the network.
5. This creates duplicate packets on the network and reduces the network efficiency.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

4. Reverse Path Multicasting (RPM)


➢ To overcome the problem of broadcasting in RPB, Reverse Path Multicasting in used.
➢ In this the desired multicast network tree is created by using two different methods: Pruning and
grafting.
➢ A router can send a prune message to its upstream router whenever it finds that its network is
not interested in a multicast packet. In this way a router prunes (cuts) its network from
multicasting.
➢ If a router receives prune message from all the downstream routers, it in turn, sends a prune message to
its upstream router.
➢ A router can also send a graft message to its upstream router if it finds that its network is again
interested in receiving the multicast packet. In this way, graft message forces the upstream
router to resume sending the multicast message. The network is again grafted (joined).

2. Multicast Open Shortest Path First (MOSPF)


➢ The Multicast Open Shortest Path First (MOSPF) protocol is a version of OSPF that allows for efficient
routing of multicast packets (as well as unicast packets) within an autonomous system.
➢ This implementation merges both OSPF and the Internet Group Management Protocol (IGMP),
which handles multicast group memberships.
➢ Use a different approach from DVMRP
❖ Using a least-cost tree (using a metric) instead of a shortest-path tree
❖ Making the tree all at once instead of gradually

3. Core-Based Tree (CBT)


➢ CBT is a group-shared protocol that uses a core as the root of the tree.
➢ AS is divided into region, and core (rendezvous router) is chosen for each region.
➢ Each router sends a unicast join message to rendezvous router.
➢ When the rendezvous router has received all join messages from every member of the group, the
tree is formed.

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

3. Protocol Independent Multicast (PIM)


➢ Protocol Independent Multicast, Dense Mode (PIM-DM)
➢ Protocol Independent Multicast, Sparse Mode (PIM-SM)
3.1 PIM-DM
➢ PIM-DM is used in a dense multicast environment, such as a LAN.
➢ PIM-DM uses RPF and pruning/grafting strategies to handle multicasting. However, it is independent
from the underlying unicast protocol
➢ PIM-DM is a source-based tree routing protocol that uses RPF and pruning/grafting strategies for
➢ multicasting
➢ Its operation is like DVMRP; however, unlike DVMRP, it does not depend on a specific unicasting
protocol.
➢ It assumes that the autonomous system is using a unicast protocol and each router has a table that can
find the outgoing interface that has an optimal path to a destination.
➢ This unicast protocol can be a distance vector protocol (RIP) or link state protocol (OSPF).
3.2 PIM-SM
➢ Used in a sparse multicast environment such as a WAN
➢ Group-shared tree routing protocol that has a rendezvous point (RP) as the source of the tree.
➢ Like CBT; but simpler because it does not require acknowledgment from a join message
➢ It creates a backup set of RPs for each region to cover RP failures.
➢ Can switch from a group-shared tree strategy to a source-based tree strategy when necessary.
• Can happen if there is a dense area of activity far from the RP.
• It can be more efficiently handled with a source-based tree strategy

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

Problem 1
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
a.10000001 00001011 00001011 11101111
b.11000001 10000011 00011011 11111111
c.11100111 11011011 10001011 01101111
d.11111001 10011011 11111011 00001111
Solution
We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for
separation:
a. 129.11.11.239
b. 193.131.27.255
c. 231.219.139.111
d. 249.155.251.15
Problem 2
Change the following IPv4 addresses from dotted-decimal notation to binary notation.
a. 111.56.45.78
b. 221.34.7.82
c. 241.8.56.12
d. 75.45.34.78
Solution
We replace each decimal number with its binary equivalent:
a. 01101111 00111000 00101101 01001110
b. 11011101 00100010 00000111 01010010
c. 11110001 00001000 00111000 00001100
d. 01001011 00101101 00100010 01001110
Problem 3
Find the error, if any, in the following IPv4 addresses:
a. 111.56.045.78
b. 221.34.7.8.20
c. 75.45.301.14
d. 11100010.23.14.67
Solution
a. There should be no leading zeroes (045).
b. We may not have more than 4 bytes in an IPv4 address.
c. Each byte should be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal notation.
Problem 4
Change the following IPv4 addresses from binary notation to hexadecimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
Solution
We replace each group of 4 bits with its hexadecimal equivalent.
a. 810B0BEF16
b. C1831BFF16

CN Question Bank
PART A

1. Which class does the following IP address belong to?


(a) 157.143.252.207 (b) 93.31.1.245
2. What is the meaning of multiple IP address at a router?
3. What is a Class B IP address?
4. What are the various notations for specifying IP address?
5. What are the differences between classful addressing and classless addressing in IPv4?

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 3 Computer Networks

6. Is the size of the ARP packet fixed? Explain.


7. What is the purpose of the Address Resolution Protocol(ARP)?
8. Find the error if any in the following IP address:
(a) 111.56.045.78 (b) 75.45.301.14
9. List out the advantages of IPv6.
10. Define tunneling with an example?
11. Define Flooding.
12. What are the lengths of the physical, logical and port address?
13. Differentiate between Unicasting and multicasting.

PART – B

14. What do you mean by sub-netting and masking? Explain it in detail with an example.
15. Discuss how distance vector routing and link state routing techniques work?
16. What is subnetting? Discuss Also state whice classes of IP address can be subnetted?
What is subnet masking?
17. Explain the IP addressing.
18. Explain Link state routing.
19. Discuss in detail about the OSPF routing protocol.
20. Draw the format of IPv4 header and describe the significance of each field.
21. Define Subnet, Flooding, Broadcast, Multicast?
22. Explain about IPv4 and IPv6.
23. Identify and Explain the steps followed in shortest path routing with an example
24. Explain Distance Vector and Link State routing Protocols.
25. Explain distance vector routing algorithm in detail.
26. What is internetworking? Explain the Header format of ipv4 and also mention the
importance of ipv6 over ipv4?
27. Define optimality principle? Illustrate shortest path routing algorithm for the given Graph

All The Best

Mr. RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A(HR).,M.Sc(Psychology).,B.Lit(Tamil).,M.A(Criminology),(Ph.D)


Assistant Professor, School of CS & AI, SR University
Unit - 4 Computer Networks

Unit - 4
Elements of transport layer, User Datagram Protocol(UDP),Transmission Control Protocol (TCP),
Data Traffic , Congestion Control , Congestion Control in TCP and Frame Relay ,Quality of
Services(QoS),Techniques to improve the QoS ,Remote Procedure Call (RPC), Real-time
Transport Protocol(RTP) .
Transport Layer
 The transport layer is responsible for process-to-process delivery of a packet, part of
message from one process to another.
 Data link layer is responsible for node to node delivery, the delivery of frames between
two neighbouring nodes over a link.
 Network layer is responsible for host to host delivery, the delivery of datagrams between
two hosts.
Example
Assume, at any moment, several processes may be running on the source host and several on the
destination host. Transport layer is responsible to deliver data from one of these processes running
on the source host to the corresponding process running on the destination host.

Figure: Two process communicate in a client server relationship


************
Elements of Transport Layer (or) Duties of TL (or) Services of TL
 Transport layer services are implemented by a transport protocol used between two
transport entities

End-to-end delivery:
 The transport layer transmits the entire message to the destination. Therefore, it ensures
the end-to-end delivery of an entire message from a source to the destination.
Or
 Transport layer overseas that the entire message arrives intact. Thus it overseas the
end to end (source to destination) delivery of an entire message.

Reliable delivery:
 The transport layer provides reliability services by retransmitting the lost and
damaged packets.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Error Control
 The data must be deliver to their destination exactly as they originated from source
 The data link layer also provides the error handling mechanism.
 If errors are occurred in the routers then transport layer error detection methods
alone can detect errors.
Sequence Control
 On the receiving end it is responsible for reassembling various pieces of transmission
correctly.
 Reassembling of pieces is done with the help of sequence number.
Loss Control
 The transport layer ensures that all the pieces of a transmission arrive at the
destination.
 Losses of pieces are identified by the sequence number and those missing pieces
are redelivered to the destination.
Duplication Control
 The transport layer allows the receiver to identify the duplicate segments by their
sequence number and discard duplicate segments.

Flow Control
 The sender may send data in one speed whereas the receiver may receive the data in
slower manner.
 So the data may be lost when there is no flow control.
 A sliding window is used to make data transmission more efficient as well as to
control the flow of data so that the receiver does not become overwhelmed.

Multiplexing
The transport layer uses the multiplexing to improve transmission efficiency.
 Upward multiplexing: Upward multiplexing means multiple transport layer
connections use the same network connection.

 Downward multiplexing: Downward multiplexing means one transport layer


connection uses the multiple network connections.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Addressing
 To identify a specific destination among many, an address is necessary.
 A transport layer address called a port number, is needed to choose among multiple
process running on the destination host.
 The destination port number is needed for delivery and source port number is needed for
reply.

Port number
 Port numbers are 16bit integers between 0 and 65535.

IANA Ranges (Internet Assigned Number Authority)


 The IANA has divided the port numbers into three ranges: well known, registered and
dynamic (private)

1. Well known Ports


 Range: 0 to 1023
 They are assigned and controlled by IANA
2. Registered Ports
 Range: 1024 to 49,151
 They are not assigned or controlled by IANA.
 They can only be registered with IANA to prevent duplication.
3. Dynamic Ports (Ephemeral ports)
 Range: 49,152 to 655,535
 They are neither controlled not registered. They can be used by any process.

 The client program can define itself with a port number, chosen randomly by the transport
layer software running on the client host. This is the ephemeral port number.
 The server process must also define itself with a port number. It cannot be chosen
randomly. It should be a well-known port number.

 Client process can use an ephemeral (temporary) port number 52,000 to identity itself.
Server process must use a well-known (permanent) port no 13.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

IP addresses Versus Port numbers

Socket Address
 The combination of IP address and a port number is called a socket address.
 Client socket address and server socket address are needed to make a connection.

************
UDP Protocol
 UDP is short for User Datagram Protocol.
 It is the simplest transport layer protocol.
 It has been designed to send data packets over the Internet.
 It simply takes the datagram from the network layer, attaches its header and sends it
to the user.

Characteristics of UDP
 It is a connectionless protocol.
 It is a stateless protocol.
 It is an unreliable protocol.
 It is a fast protocol.
 It offers the minimal transport service.
 It does not guarantee in order delivery.
 It does not provide congestion control mechanism.
 It is a good protocol for data flowing in one direction.

Advantages
 Minimum Overhead
 No error checking
 Convenient protocol for multimedia and multicasting applications
 Connectionless Protocol
 No need for connection establishment

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Disadvantages
 No reliable services
 Packets are not numbered
 Delayed
 Loss of data

UDP Header
 The following diagram represents the UDP Header Format-

1. Source Port-
 Source Port is a 16 bit field.
 It identifies the port of the sending application.
2. Destination Port-
 Destination Port is a 16 bit field.
 It identifies the port of the receiving application.
3. Length-
 Length is a 16 bit field.
 It identifies the combined length of UDP Header and Encapsulated data.
Length = Length of UDP Header + Length of encapsulated data
4. Checksum-
 Checksum is a 16 bit field used for error control.
 It is calculated on UDP Header, encapsulated data and IP pseudo header.
 Checksum calculation is not mandatory in UDP.

Queue in UDP

 At the client side, when a process starts, it requests a port number from the operating
system. Some implemetations create both an incoming and an outgoing queue associated
with each process.
 If a process wants communicate with multiple processes, it obtains only one port
number and eventually one outgoing and one incoming queue.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

 When a message arrives for a client, UDP checks to see if an incoming queue has been
created for the port number. If yes, put into the queue, if not, send ICMP a port
unreachable.

Applications
 UDP is a suitable for multicasting and broadcasting
 UDP is used for management processes such as SNMP
 UDP is used for route updating protocols such as RIP
 UDP is suitable for a process with internal flow and error-control mechanisms like Trivial
File Transfer Protocol.
***********
Transmission Control Protocol-
 Transmission Control Protocol is a transport layer protocol.
 It continuously receives data from the application layer.
 It divides the data into chunks where each chunk is a collection of bytes.
 It then creates TCP segments by adding a TCP header to the data chunks.
 TCP segments are encapsulated in the IP datagram.
 TCP segment = TCP header + Data chunk
TCP Header-
The following diagram represents the TCP header format

1. Source Port
 16 bit field.
 It identifies the port of the sending application.
2. Destination Port-
 16 bit field.
 It identifies the port of the receiving application.
3. Sequence Number-
 32 bit field.
 TCP assigns a unique sequence number to each byte of data.
 This field contains the sequence number of the first data byte.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

4. Acknowledgement Number-
 32 bit field.
 It contains sequence number of the data byte that receiver expects to receive next
from the sender.
 It is always sequence number of the last received data byte incremented by 1.
5. Header Length-
 4 bit field.
 It contains the length of TCP header.
 It helps in knowing from where the actual data begins.
 Minimum and Maximum Header length-
o [20 bytes , 60 bytes]
6. Reserved Bits-
 The 6 bits are reserved.
 These bits are not used.
7. URG Bit-
URG bit is used to treat certain data on an urgent basis.
When URG bit is set to 1,
 It indicates the receiver that certain amount of data within the current segment is
urgent.
 Urgent data is pointed out by evaluating the urgent pointer field.
 The urgent data has be prioritized.
 Receiver forwards urgent data to the receiving application on a separate channel.
8. ACK Bit-
ACK bit indicates whether acknowledgement number field is valid or not.
 When ACK bit is set to 1, it indicates that acknowledgement number contained in
the TCP header is valid.
 For all TCP segments except request segment, ACK bit is set to 1.
 Request segment is sent for connection establishment during Three Way
Handshake.
9. PSH Bit-
PSH bit is used to push the entire buffer immediately to the receiving application.
When PSH bit is set to 1,
 All the segments in the buffer are immediately pushed to the receiving application.
 No wait is done for filling the entire buffer.
 This makes the entire buffer to free up immediately.
10. RST Bit-
RST bit is used to reset the TCP connection
When RST bit is set to 1,
 It indicates the receiver to terminate the connection immediately.
 It causes both the sides to release the connection and all its resources abnormally.
 The transfer of data ceases in both the directions.
 It may result in the loss of data that is in transit.
11. SYN Bit-
SYN bit is used to synchronize the sequence numbers.
When SYN bit is set to 1,
 It indicates the receiver that the sequence number contained in the TCP header is
the initial sequence number.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

 Request segment sent for connection establishment during Three way handshake
contains SYN bit set to 1.
12. FIN Bit-
FIN bit is used to terminate the TCP connection.
When FIN bit is set to 1,
 It indicates the receiver that the sender wants to terminate the connection.
 FIN segment sent for TCP Connection Termination contains FIN bit set to 1.
13. Window Size-
 Window size is a 16 bit field.
 It contains the size of the receiving window of the sender.
 It advertises how much data (in bytes) the sender can receive without
acknowledgement.
 Thus, window size is used for Flow Control.
14. Checksum-
 Checksum is a 16 bit field used for error control.
 It verifies the integrity of data in the TCP payload.
 Sender adds CRC checksum to the checksum field before sending the data.
 Receiver rejects the data that fails the CRC check.
15. Urgent Pointer-
 Urgent pointer is a 16 bit field.
 It indicates how much data in the current segment counting from the first data
byte is urgent.
 Urgent pointer added to the sequence number indicates the end of urgent data byte.
 This field is considered valid and evaluated only if the URG bit is set to 1.
16. Options-
 Options field is used for several purposes.
 The size of options field varies from 0 bytes to 40 bytes.
 Options field is generally used for the following purposes-
1.Time stamp
2.Window size extension
3.Parameter negotiation
4.Padding
***************
TCP Services
Services offered by TCP are
1. Stream delivery service
2. Full duplex service
3. Connection Oriented services
4. Flow control
5. Congestion control
Stream Delivery Service
 The establishes a connection between the sender and the receiver (it’s like a bridge that
connects only the sender and the receiver.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

 The sender process sends data as a stream of bytes and the receiver process receives it in
the same order as stream of bytes.
Buffers
 The Sending process and receiving process vary in their speed of producing and
consuming. So a circular array of 1 byte locations (buffer) is used in the sender side and
also in receiver side for storage.

Sending buffer (3 locations)


1. Bytes to be sent
2. Bytes sent but not acknowledged
3. Empty location
Receiving Buffer (2 locations)
1. Bytes to be processed by the receiver
2. Empty locations
TCP Segments
 IP layer is the service provider for TCP.
 It sends data as packets, not as stream of bytes so TCP encapsulates group of bytes into
segments and deliver the segments to IP.
 The segments are encapsulated in IP datagram and then transmitted.
 The unit of data transfer using TCP is called TCP segments.

Full Duplex Service


 The data can be sent in both the directions.
 The sender and the receiver have two buffers, for sending and receiving data in full duplex
transmission.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Connection – Oriented Service


1 Connection Establishment (3-way Handshacking)
 TCP traffic begins with a three-way handshake. In this TCP handshake process, a client needs to
initiate the conversation by requesting a communication session with the Server:

Step 1 (SYN):
In the first step, client wants to establish a connection with server, so it sends a segment
with SYN(Synchronize Sequence Number) which informs server that client is likely to
start communication and with what sequence number it starts segments with

Step 2 (SYN + ACK):


Server responds to the client request with SYN-ACK signal bits set.
Acknowledgement(ACK) signifies the response of segment it received and SYN signifies
with what sequence number it is likely to start the segments with

Step 3 (ACK):
In the final part client acknowledges the response of server and they both establish a
reliable connection with which they will start the actual data transfer

2 Data Transfer in TCP


 When a packet of data is sent over TCP, the recipient must always acknowledge what they
received.
 The first computer sends a packet with data and a sequence number. The second computer
acknowledges it by setting the ACK bit and increasing the acknowledgement number by
the length of the received data.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

3 Connection Termination
 Either computer can close the connection when they no longer want to send or receive
data.
 A computer initiates closing the connection by sending a packet with the FIN bit set to 1
(FIN = finish).
 The other computer replies with an ACK and another FIN. After one more ACK from the
initiating computer, the connection is closed.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

4-Way Handshake
Specifically, in order for an established TCP connection to be terminated, the following 4 TCP
packets are exchanged:
1. Client → Server: FIN flag set.
2. Server → Client: ACK flag set.
3. Server → Client: FIN flag set.
4. Client → Server: ACK flag set.

Flow Control
 The amount of data flowed from a source to destination should be restricted.
 The source can send all n bytes at a time. But it will result in overwhelming the
receiver and the network.
 TCP defines the window on the source buffer. To control flow of data TCP uses Sliding
Window protocol.
Sliding Window Protocol:
 The window holds a portion of a buffer so the bytes within the window can be sent without
worrying about the acknowledgement. The acknowledgement can be cumulative..

 Congestion Window (cwnd) is a TCP state variable that limits the amount of data the
TCP can send into the network before receiving an ACK.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

 The Receiver Window (rwnd) is a variable that advertises the amount of data that the
destination side can receive.
 Together, the two variables are used to regulate data flow in TCP connections,
minimize congestion, and improve network performance.
Example:

**************
Data Traffic
 Network traffic is the amount of data moving across a computer network at any given
time.
 Network traffic, also called data traffic, is broken down into data packets and sent over
a network before being reassembled by the receiving device or computer.
 The main focus of congestion control and quality of service is data traffic.
 In congestion control we try to avoid traffic congestion.
 In quality of service, we try to create an appropriate environment for the traffic.
Traffic Descriptors

 Average Data Rate = amount of data/time


 Peak Data Rate = The max data rate of traffice
 Max burst size = The max length of time the traffic is generated at the peak rate.
 Effective bandwidth = bandwidth that the network needs to allocate for traffic flow.

Traffic Profiles
 Constant – Bit Rate (CBR)
 Variable – Bit Rate (VBR)
 Bursty

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

**************
Congestion Control
 The number of packets sent to the network is greater than the capacity of the
network.
 Congestion control – The mechanisms to control the congestion and keep the load
below the capacity.
 Congestion occurs because routers and switches have queues – buffers that hold the
packets before and after processing.

Types of Congestion control mechanism


1. `Open loop – prevent congestion before congestion occurs.
2. Closed loop – removes congestion after congestion occurs.

Congestion control categories

Open Loop Control: Prevention

1 . Retransmission Policy
 If the packet is lost or corrupted, the same packet is retransmitted.
 This retransmission generally increases congestion.
 Retransmission Policy and Timers must to be designed to optimize efficiency and
at the same time prevent congestion
2 . Window Policy
 Selective Repeat ARQ’s window is better than Go-back-N
 In Go-back-N all the packets in the window are resent.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

 Where in Selective Repeat ARQ only damaged packets resent.

3 . Acknowledgement Policy
 If every packet is acknowledged than the network is congested.
 Instead the receiver can acknowledge N packets at a time (group of
acknowledgement) to avoid congestion.
Example:-
 The receiver can send only one ACK (ACK 7) after receiving the packets 0,1 to 6.
So for 7 packets only one ACK is sent by the receiver which reduces congestion.

4 . Discarding Policy
 Prevent congestion and at the same time don’t damage the integrity of the
transmission.
Example:- In audio transmission less sensitive packets are discarded.

5 . Admission Policy
 Switch first check the resource equipment of a flow before admitting it to the
network.

Closed Loop Control: Removes


To provide mechanisms to recover congestion after the congestion occurs.

1 . Back Pressure
 Backpressure is a node-to-node congestion control that starts with a node and
propagates, in the opposite direction of data flow, to the source.
 The backpressure technique can be applied only to virtual circuit networks, in
which each node knows the upstream node from which a flow of data is coming.

o If congestion occurs in node C.


o C informs B to stop sending data.
o In turn if B gets congested, it informs A to stop sending data.
o This is called back pressure.
o The back pressure is applied till the source node.
o Source node has to stop sending data.
2 . Choke Packet
 A choke packet is sent from the congested router (node) to the source directly to
inform and warn it about congestion occurrence.
 Intermediate nodes do not take any congestion control actions.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

3 . Implicit Signalling
The source itself understands the occurrence of congestion from the delay of
acknowledgement and slows down its data flow rate.

4 . Explicit Signalling
The congested node includes a signal in the data packet itself and sends it to source or
destination. So the source/destination is informed and warned about congestion.
a. Backward Signalling
Packets flow to the source contains a bit which is set to inform the source
about the congestion.

b. Forward Signalling
Packets flow to destination contains a bit which is set to inform the destination
about the congestion.
*********
Congestion Control in TCP
TCP reacts to congestion by reducing the sender window size.

1 .Slow Start Phase: Exponential increment –

In this phase after every Round Trip


Time (RTT) the congestion window size
increments exponentially.

Initially cwnd(congestion window) = 1


After
1 RTT, cwnd = 2^(1) = 2
2 RTT, cwnd = 2^(2) = 4
3 RTT, cwnd = 2^(3) = 8

2 . Congestion Avoidance Phase: Additive increment –


 This phase starts after the threshold value also denoted as ssthresh (SlowStart
Threshold).
 The size of cwnd increases additively. i.e. After each RTT, cwnd = cwnd + 1

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

3 . Multiplicative decrease (Congestion Detection)


 If any ACK doesn’t reach within specified time or only some ACK was received, the
sender assumes that the congestion has occurred.
 So the threshold is set to half of the current window size and then either slow start
phase is started or congestion avoidance phase is started.
*********
Congestion control is Frame Relay
 Congestion Avoidance is done in frame relay protocol by using two bits in the frames
to explicitly warn the source and destination about the occurrence of congestion.

1.Backward Explicitly Congestion Notification (BECN)


 BECN bit warns the senders of congestion in the network.
 The sender reduces the data rate.

2. Forward Explicitly Congestion Notification (FECN)


 FECN bit is used to warn the receiver of congestion in the network.
 The receiver can delay ACK so that the sender slows down the data rate.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Four cases of Congestion

***********
Quality Of Service(QoS)
 The goal of QoS is to provide preferential delivery service for the applications that
need it by ensuring sufficient bandwidth, controlling delay and jitter, and reducing
data loss.
 Quality of Service(QoS) is basically the ability to provide different priority to different
applications, users, or data flows, or in order to guarantee a certain level of performance to
the flow of data.
 In other words, we can also define Quality of Service as something that the flow seeks to
attain.

Important flow characteristics of the QoS are given below:

1.Reliability
 If a packet gets lost or acknowledgement is not received (at sender), the re-
transmission of data will be needed.
 This decreases the reliability.
For example:
E- mail and file transfer need to have a reliable transmission as compared to that of an
audio conferencing.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

2. Delay
 Delay of a message from source to destination is a very important characteristic.
o However, delay can be tolerated differently by the different applications.
For example:
The time delay cannot be tolerated in audio conferencing (needs a minimum
time delay), while the time delay in the e-mail or file transfer has less
importance.
3.Jitter
 The jitter is the variation in the packet delay.
 If the difference between delays is large, then it is called as high jitter.
 On the contrary, if the difference between delays is small, it is known as low jitter.
Example:
Case1: If 3 packets are sent at times 0, 1, 2 and received at 10, 11, 12. Here, the delay
is same for all packets and it is acceptable for the telephonic conversation.
Case2: If 3 packets 0, 1, 2 are sent and received at 31, 34, 39, so the delay is different
for all packets. In this case, the time delay is not acceptable for the telephonic
conversation.
4. Bandwidth
 Different applications need the different bandwidth.
For example:
Video conferencing needs more bandwidth in comparison to that of sending an e-mail.

Some scheduling techniques to improve the Quality of Service include


1. FIFO Queueing
2. Priority Queueing
3. Weighted Fair Queueing

Scheduling: FIFO queue


 The packets wait in the buffer (queue) till the switch or router is ready to process
those packets.
 If the packets arrive in faster rate than the switch process those packets, then the
queue gets filled and new packets are discarded.
 The packet comes first is processed first.

Scheduling: Priority queuing

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

 Packets are assigned to a priority class.


 Each priority class has a separate queue.
 The packets in high priority queue are processed first.
 If the queue with higher priority is empty the next lower priority queue is processed.

Drawback
If the high priority data arrives continuously the low priority queue will not
get a chance to be processed. So starvation occurs.

Scheduling: Weighted fair queuing


 To avoid starvation each queue is given some weights like 3,2 etc.,
 So 3 packets from queue are processed and then processor skips to next queue and
process 2 packets and so on.

Advantage:
As the queues follow round robin scheduling starvation does not occur.
**********
Traffic Shaping
It is a mechanism to restrict the amount and rate of traffic sent to the network.

Techniques for traffic shaping.


 Leaky bucket
 Token bucket

Leaky Bucket
 Leaky Bucket algorithm controls burst traffic to fixed rate traffic.
 A bucket has a small hole at the bottom.
 The water leaks from the bucket at constant rate till the bucket has water.
 If the bucket is full the incoming water fills out.
 The input rate can vary but the output rate is constant.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

 FIFO Queue is used for bucket.


 If the buckets arriving are fixed size at each tick some ‘n’ packets are removed from
the queue for processing.

*********
Token Bucket
 The token bucket allows bursty traffic at a regulated maximum rate.
 It allows burst traffic at regulated maximum rate traffic.
 Leaky bucket does not credit an idle host.
 Token bucket considers an ideal host.
 An idle host reserves credit for the future in form of tokens.
 If a host is idle it sends ‘n’ token for every tick.
 If the host sends some data in future, for every call sent a token is removed from the
bucket.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Resource Reservation
 The flow of data requires some resources like buffer, bandwidth, cpu time etc.,
 If these resources are reserved in advance then QoS can be improved.

Admission control
 It is used to manage incoming traffic and to prevent the network congestion.
 The main function of AC is to maximize the utilization of network resources and to
ensure the level of QoS.
**************
Remote Procedure Call (Rpc)`
 Remote Procedure Call (RPC) is a protocol that one program can use to request a
service from a program located in another computer on a network without having to
understand the network's details.
 A procedure call is also sometimes known as a function call or a subroutine call.
 RPC uses the client-server model.
 The requesting program is a client and the service providing program is the server.
Principle of RPC

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Implementation of RPC involves the five elements of program:


1. Client
2. Client Stub (stub:- Piece of code used for converting parameters)
3. RPC Runtime (RPC communication package)
4. Server stub
5. Server

 The client, client stub, and one instance of RPC Runtime execute on the client
machine.
 The server, server stub, and one instance of RPC Runtime execute on the server
machine.
Client
 It is user process which initiates a RPC
 The client makes perfectly normal call that invokes a corresponding procedure in
the client stub.
Server
 After receiving a request from the client, the server stub passes it to the server.
 If necessary, return values are passed back to the client using the same technique.

Stub
It is a piece of code that converts parameters passed between client and server during
a remote procedure call (RPC), they provide a normal / local procedure call.

Client Stub
 On receipt of a request it packs a requirement (marshall) into a message and
asks to RPC Runtime to send.
 On receipt of a result it unpacks the result and passes it to client.
Server stub
 It unpacks a call request and makes a perfectly normal call to invoke the
appropriate procedure in the server.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

RPC Runtime
 It handles transmission of message between client and server

Steps For RPC Mechanism


1. Client procedure calls client stub in normal way.
2. Client stub builds message (marshall), calls RPC runtime.
3. The RPC runtime transmits message to the server using message passing (via network).
4. A similar stub on the server side receives this message, unpacks paramaters (unmarshall),
calls server.
5. Server does the work, returns result to the server stub.
6. Server stub packs (marshall) it in message, calls RPC runtime.
7. The RPC runtime transmits message to the client using message passing (via network)
8. Client stub unpacks (unmarshall) result, returns to client.
************
Real-time Transport Protocol (RTP)
 Real-time Transport Protocol (RTP) is the protocol designed to handle real-time traffic
on the Internet.
 RTP does not have a delivery mechanism; it must be used with UDP.
 RTP stands between UDP and the application program.
 RTP is designed for end-to-end, real-time, transfer of stream data.
 The protocol provides facility for jitter compensation and detection of out of sequecnce
arrival in data, that are common during transmissions on an IP network.
 RTP supports data transfer to multiple destinations through IP multicast.
 The main contributions of RTP are time stamping, sequencing and mixing facilities.

Requirements for RTP


1 sequencing
To report data loss
To report data reordering
2 Time Stamping and Buffering
For jitter and delay calculation
3 Payload type identification
For media interpretation
4 Rate control
Sender reduces sending rate adaptively to network congestion
5 QoS feedback
From receiver to sender for operation adjustment

RTP Header
Ver
 2 bit field.
 It defines the version number
 Current version is 2

P
 1 bit field
 If set to 1,the presence of padding at the end of the packet.
 If set to 0, there is no padding.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

X
 1 bit field
 If set to 1,indicates an extra extension header between the basic header and the data..
 If set to 0, there is no extra extension.

Contributor count
 4 bit field
 It indicates the number of contributors.
 Maximum contributors 15 (allow 0 to 15)

Payload
 7 bit field
 It represent unique number in RTP header format.
 Every payload type indicates a specific Encoding of audio/video media.

Sequence Number
 16 bit field
 To give serial numbers to RTP packets.
The sequence number for first packet is given a random number and then every next
packet’s sequence number is incremented by 1.
 This field mainly helps in checking lost packets and order mismatch.

Timestamp
 32 bit field
 It is used to find relationship between times of different RTP packets.
 The timestamp for first packet is given randomly and then time stamp for next packets
given by sum of previous timestamp and time taken to produce first byte of current packet.

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

Synchronization source identifier


 If there is only one source, this 32-bit field defines the source.
 However, if there are several sources, the mixer is the synchronizaion source and the other
source are contributors

Contributor Identifier
 This is also a 32-bit field used for source identification where there is more than one
source present in session.
 The mixer source uses Synchronization source identifier and other remaining sources
(maximum 15) use Contributor identifier.
 The data transmission over RTP Protocol is shown below:

Real-Time Transport Control Protocol


 RTP allows only one type of message, one that carries data from the source to the
destination. In many cases, there is a need for other messages in a session.
 These messages control the flow and quality of data and allow the recipient to send
feedback to the source or sources.
 Real-time Transport Control Protocol (RTCP) is a protocol designed for this purpose.
RTCP message types

1. Sender Report: The sender report is sent periodically by the active senders in a
conference to report transmission and reception statistics for all RTP packets sent during
the interval.
2. Receiver Report: The receiver report is for passive participants, those that do not send
RTP packets.
3. Source Description Message: The source periodically sends a source description message
to give additional information about itself.
4. Bye Message: A source sends a bye message to shut down a stream. It allows the source to
announce that it is leaving the conference
5. Application-Specific Message: The application-specific message is a packet for an
application that wants to use new applications (not defined in the standard).

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 4 Computer Networks

CN Question Bank
Part - A
1. What are the optional fields in TCP header format?
2. Write briefly about RTP?
3. Differentiate between TCP and UDP.
4. Name any two congestion control Algorithms.
5. List the duties of Transport Layer
6. What is a Socket? Define Socket Address.
7. What is congestion? How to control congestion?
8. Define Jitter
9. How are congestion control and quality of service related?
10. Give the format for UDP datagram and give the meaning for each field.
11. What is traffic shaping
12. Define Choke packet

Part - B
1. Discuss about TCP header format.
2. Explain the protocol scenarios for establishing connection using three way hand shake
mechanism?
3. In cases where reliability is not of primary importance, UDP would make a good transport
protocol. Give examples of specific cases.
4. Write the importance of Quality of Service(QoS)? Explain how QoS is provided in UDP?
5. Explain the Services of Transport layer
6. Draw and explain each field in the TCP Segment header.
7. Explain in detail about the Real Time Transport Protocol.
8. Explain in detail about the congestion control mechanism in TCP and UDP.
9. What is Congestion? What are the different criteria for occurrence of congestion and
explain
10. Explain about Connection establishment and connection termination using three-way
handshaking in TCP
11. Explain the steps involved in computing checksum for an UDP Datagram.
12. Explain Four-way Handshaking method of terminate a connection in TCP
13. How to avoid the congestion in TCP? Explain it in detail.
14. Compare connection oriented protocol and connectionless protocol.

All The Best

RADHAKRISHNAN.P., M.Tech(CSE).,M.C.A.,M.B.A.,M.Sc(Psychology).,B.lit(Tamil),M.A(Criminology).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

UNIT V
Presentation Layer
Data Formatting, Data Compression-Audio and Video Compression. Network Security- cryptographic tools, the
problems of key distribution, General authentication techniques-IPSec, PGP, Firewalls.
Application Layer
Electronic Mail-Architecture, User Agent, DNS, SMTP, POP and IMAP. File Transfer Protocol.

Data Formatting
 The most common transformations of network data is from the representation used by the
application program into a form that is suitable for transmission over a network and vice versa.
 This transformation is typically called data formatting.
1. Translation:
For example: ASCII to EBCDIC.
2. 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.
3. Compression:
Reduces the number of bits that need to be transmitted on the network.
*******
Data Compression
 To utilize these resources efficiently, the data is often required to be compressed, i.e.,
reduced to a smaller size without losing any or losing minimal information.

MP3 (Audio Compression)


 Audio compression can be used for speech and music.
 Two techniques are used for audio compression, they are
1. Predictive Encoding:
o In this technique, the differences between the samples are encoded instead of
encoding all the sampled values.
o This type of compression is normally used for speech.
2. Perceptual Encoding:
o The most common compression technique that is used to create CD quality audio is
based on perceptual encoding technique.
o MP3 uses this technique Perceptual encoding is based on the science of
psychoacoustics, the study of how people perceive sound.
o The idea is based on the flaws in our auditory system. i.e. some sounds can mask
other sounds and masking can happen in frequency and time.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Video Compression
 A video is composed of multiple frames and each frame is an image.
 So, a video can be compressed by compressing the images first.
2 Standard Techniques
1. JPEG (Joint Photographic Experts Group) - To compress image
2. MPEG (Moving Picture Experts Group) - To compress video
1. JPEG
 In this technique, each frame (image) is divided into small girds called picture elements or pixels.
 For a gray scale image (Black and White TV) each pixel is represented with 8 bit value, thus forming
a total of 256 gray levels.
 For a color picture, each pixel is represented with 24 bit value, with 8 bits for each primary color
(Red, Green and Blue)

2. MPEG
 MPEG full form is Moving Picture Experts Group.
 In general, a motion picture (video) is a rapid flow of set of frames, where each frame is an image
i.e. A frame is a spatial combination of pixels and a video is a temporal (time) combination of frames
that are sent one after the other.
 The MPEG method first divides the frames into three categories:
1. I – Frame (Intra-coded frame)
2. P – Frame (Predicted frame)
3. B – Frame (Bidirectional frame)
I – Frame:
 It is an independent frame that is not related to any other frame (not to the frame sent
before or after).
P – Frame: (Forward Direction)
 It is related to the preceding I-Frame or P-Frame.
 Each P-Frame contains only the changes from the preceding frame.
B – Frame: (Bi-Direction)
 It is related to the preceding and following I-Frame or P-Frame.
 Each B-Frame is relative to the past and future frames.

*******
Network Security
 Network security involves all activities that organizations, enterprises and institutions undertake to
protect the data and the integrity.
Network Security Services
1. Confidentiality
2. Integrity Deals with message
3. Authentication
4. Non-repudiation
5. Authentication of Entity – Deals with entity

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

1. Message Confidentiality
 Message confidentiality or privacy means the transmitted message must be understand only by
the sender and receivers.
 Example:- Bank and Customers interaction must be confidential
2. Message Integrity
 Message Integrity is the arrival of message without any error.
 The message sent by the sender should not be accidently or maliciously changed during
transmission.
 If it is changed the original content can’t be received by the receiver. So the transaction is
not secure.
 Message digest is a method to preserve integrity of message during transaction.
3. Message Authentication
 Message authentication means sender and receiver must confirm the identity of each other.
 The receiver must be sure that the message is from the sender.
 Modification Detection Code (MDC) can detect any modification in the message.
4. Message Non Repudiation
 Non Repudiation is that the sender must not be able to deny sending a message.
 Non Repudiation guarantees that the sender sends a message and can’t deny sending, and the
recipient cannot deny having received the message.
 Non Repudiation is obtained through
1. Digital Signature – It like a unique identifier for an individual like a written signature.
2. Time Stamps – It contains the date and time a document was composed and proves
that a document existed at a certain time.
5. Entity Authentication
 The host can be protected by access control and authentication of users.
 Password during login process is the traditional authentication method.
 Only authenticated users are allowed to access.
 Example:- gmail login, facebook login
*********
Cryptography Tool
 Cryptography is an art of transforming messages (original messages to another form) to make them
secure and immune to attacks.
 Cryptography is the science of encrypting and decryption data to prevent unauthorized access.

Components of Cryptography
1. Plaintext - Original message sent by the sender is called the plaintext. (Before encryption)
2. Cipher Text -To convert original message into secret message. (After Encryption)
Algorithm
1. Encryption Algorithm => Plaintext to Cipher text
2. Decryption Algorithm => Cipher text to plaintext
Example

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Applications of Cryptography
1. Digital Signatures
2. Safe online banking
3. Secure chatting services
4. Encrypted Emails
5. Crypto-currency

Cryptography algorithms
They are divided into two groups.
1. Symmetric key (secret key)
2. Asymmetric key (public key)

1. Symmetric key Cryptography


 Both sender and receiver uses the same key for encryption and decryption.
 The key needs to be kept secret and be available with both the sender and receiver. (single key
used by both)
Advantages:-
o Less time for
encryption/decryption
o It is efficient
o Disadvantages:-
o Distribution of the key between
the parties is difficult.
o Each pair of users need a
unique key. “N” people needs
N(N-1)/2 keys.

2. Asymmetric Key Cryptography


 It uses two different keys for encryption and decryption.
 The key used for encryption is the public key, and the key used for decryption is
the private key.
Applications
o Digital Signatures to maintain authenticity
of documents.
o Encrypted browsing sessions for better
protection against hackers
o Managing Crypto-currency transactions
securely.

**********
The problems of key distribution
 Key Distribution means of exchanging key between two parties
 Keys are used for conventional encryption
 Frequently key exchanges are desirable
 Strength of cryptographic system rests with key distribution mechanism
 Symmetric schemes require both parties to share a common secret key; issue is how to securely
distribute this key.
 Often a secure system failure due to a break in the key distribution scheme.

Example: - Two parties A and B can have various Key Distribution alternatives.
1. A can select key and physically deliver to B
2. Third party can select and deliver key to A & B
3. If A & B have communicated previously can use previous key to encrypt a new key
4. If A & B have secure communications with a third party C, C can relay key between A & B

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

General authentication techniques


 Authentication: - Verifies the identity of the user or a service
 Authorization: - Verifies what level of access the user have (Giving someone permission to access the
resources)
Example: When you go to airport, you show your ID to authenticate your identity (maybe you
show Aadhaar card). When you arrive at the gate, you show boarding ticket, they can authorize
you to board your flight (authorization)
1. Password authentication
 User enters username and password to verify the identity.
 Ex:- gmail login, facebook login.
2. Multi factor authentication (MFA) or Two Factor authentication (2FA)
 Requires two or more independent ways to identity user.
 User enters username and password, once verified he again need to enter OTP sent to his
mobile.
 Ex:- IRCTC login
3. Token based authentication
 Enter credentials once and receive token to access the system.
 Ex:- a radio frequency identification card (used in IT company)
4. Certificate based authentication
 User provide certificate to get access to the system.
 Ex:- the humble smart card often used for access to offices and other buildings (real time
example – MLA pass)
5. Biometric Authentication
 It relies on unique biological characters of individual.
 Ex:- Facial, Speaker Recognition, eyes scanner, finger print.
6. Single Sign-on
 Enter credentials once to gain access to multiple applications.
 Ex:- if you log in to a Google service such as Gmail, you are automatically authenticated to
YouTube, facebook, and other Google apps.
*********
IPSec
 IPSecurity (IPSec) – Internet Protocol Security
 IPSec is a framework for protecting communications over internet.
 IPSec is a collection of protocols designed by the Internet Engineering Task Force (IETF)
Applications of IPSec
1. Secure branch office connectivity over internet. Ex:- Net banking
2. Secure remote access over internet. Ex:- work from home
3. Enhancing electronic commerce security (online shopping). Ex:- Amazon, Flipkart.

IPSec Operates on Two modes

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Transport mode
 IPSec protects what is delivered from the transport layer to the network layer (it protects the payload).
 Transport mode does not protect the IP header.
 Transport mode does not protect the whole IP packet; it protects only the packet from the transport
layer.
Tunnel mode
 In Tunnel port, IPSec protects the entire IP packet.
 It takes an IP packet, including the header, applies IPSec security methods to the entire packet,
and then adds a new IP header.
 Normally used between
o Two routers
o A host and a router
o A router and a host

1. Authentication Header (AH) Protocol in transport mode


 The AH protocol provides source authentication and data integrity, but not privacy.
 The Authentication Header (AH) protocol is designed to authenticate the source host and to
ensure the integrity of the payload carried in the IP packet.
 The protocol uses
o A hash function and
o A symmetric (secret) key to create a message digest.
 The digest is inserted in the authentication header.
 The AH is then placed in the appropriate location, based on the mode (transport or tunnel).

Next Header :-
 8-bit
 It defines the type of payload carried by the IP datagram (such as TCP, UDP, ICMP, or
OSPF)
Payload Length:-
 8-bit
 It defines the length of the authentication header.
Security Parameter Index:-
 32-bit
 SPI field plays the role of a virtual circuit identifier and is the same for all packets sent
during a connection called a security association.
Sequence number:-
 32-bit
 It provides ordering information for a sequence of datagram.
Padding:-
 Variable length field 0 to 255 bytes.
 0’s for padding
Authentication Data
 The result of applying a hash function to the entire IP datagram except for the fields that are
changed during transit (eg:- time to live).

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

2. Encapsulating Security Payload (ESP) Protocol in transport mode


 The AH protocol does not provide confidentiality, only source authentication and data integrity.
 It provides source authentication, integrity and confidentiality.
 ESP adds a header and trailer.

ESP Procedure to follow:-


1. An ESP trailer is added to the payload.
2. The payload and the trailer are encrypted.
3. The ESP header is added.
4. The ESP header, payload and ESP trailer are used to create the authentication data.
5. The authentication data are added to the end of the ESP trailer.

************

PGP (Pretty Good Privacy)


 PGP stands for Pretty Good Privacy (PGP) which is invented by Phil Zimmermann.
 PGP was designed to provide all four aspects of security, i.e., privacy, integrity, authentication, and
non-repudiation in the sending of email.
 PGP uses a digital signature (a combination of hashing and public key encryption) to provide
integrity, authentication, and non-repudiation.
 PGP uses a combination of secret key encryption and public key encryption to provide privacy.
Therefore, we can say that the digital signature uses one hash function, one secret key, and two
private-public key pairs.
 PGP is an open source and freely available software package for email security.
 PGP provides authentication through the use of Digital Signature.
 It provides confidentiality through the use of symmetric block encryption.
 It provides compression by using the ZIP algorithm, and EMAIL compatibility using the radix-64
encoding scheme.

PGP at the Sender site (A)

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Following are the steps taken by PGP to create secure e-mail at the sender site:
 The e-mail message is hashed by using a hashing function to create a digest.
 The digest is then encrypted to form a signed digest by using the sender's private key, and then
signed digest is added to the original email message.
 The original message and signed digest are encrypted by using a one-time secret key created by
the sender.
 The secret key is encrypted by using a receiver's public key.
 Both the encrypted secret key and the encrypted combination of message and digest are sent
together.

PGP at the Receiver site (B)

Following are the steps taken to show how PGP uses hashing and a combination of three keys to generate
the original message:
 The receiver receives the combination of encrypted secret key and message digest is received.
 The encrypted secret key is decrypted by using the receiver's private key to get the one-time
secret key.
 The secret key is then used to decrypt the combination of message and digest.
 The digest is decrypted by using the sender's public key, and the original message is hashed by
using a hash function to create a digest.
 Both the digests are compared if both of them are equal means that all the aspects of security are
preserved.
************
Firewalls
 Hardware or software-based security system which is used in network is called firewall.
 Firewall can control incoming and outgoing traffic of according to rules.
 Firewalls filter the traffic and allowed onto the network that you define in firewall policy and all other
traffic will denied.
 It protects your data from unauthorized user.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Network Based Firewall or Hardware Firewall


 Hardware firewalls are special boxes that
contain customized hardware and software.
 So it’s the best solution for a company who
wants a security for its network.
 But is too expansive, tricky, difficult to
configure and difficult to upgrade.

Host Based Firewall or Software Firewall


 Software firewalls are ideal for small business
and organizations or home users or host.
 Software firewalls are easy to use, less
expansive, easy to upgrade and easy to
configure.

Working principle of Firewalls


1. General Strategy
 Allow-All: - It will allow all the network packets except those who are explicitly
denied.
 Deny-All: - It will deny all the network packets except those who are explicitly
allowed.
2. Filtering properties
 Stateless Packet Filtering: - previous passed packet didn’t remember by firewall.
 Stateful Packet Filtering: - previous passed packet will remembered by firewall
Packet Filtering
 It is the process of passing or
blocking the packets.
 It is the one of basic firewall.
 First step is to secure internal user
from external threats.
 Most of the routers and system have
built-in packet filtering.
 It applies set of rules on each
incoming packet (data) and
forwards the packets if rules are
obeyed otherwise discard.

1. Stateless Packet Filtering


o If the information of previous passed packet didn’t remember by firewall it is
called stateless packet filtering.
o These types of firewalls are not good because hackers can easily hack.
2. Stateful Packet Filtering
o If the information of previous passed packet will remembered by firewall it is
called stateful packet filtering.
o It also called smart firewalls or Dynamic Packet Filtering.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Application Level Gateway


 It will decide that either a packet to drop or send.
 This will be done by setting up different type of proxies on a single firewall for different applications.
 Both the client and the server connect to these proxies instead of connecting each others.
 So any suspicious data and connection are dropped by these proxies.

Circuit Level Gateway


 It is used by trust internal user for allowing general outbound connections.
 It has two TCP connections; one is between itself and TCP user on an inner host and one between itself
and TCP on an outside host.

Advantages of firewalls
 A good and properly-configured firewall will defiantly help you to shield your PC from outsider’s
hacker attacks.
 Firewall can block evil packets that can be harmful for receiver.
 Reduce network Loads

Disadvantages of firewalls
 Packet filtering by a software firewall can affect your system’s performance, because it will take
time to check every packet. A hardware firewall eases this burden.
 Maintains a firewall is difficult
 Firewalls are expansive.
 Difficult to identifies inside attack
 Very difficult to prevent from completely new threats
********
Electronic Mail (E-Mail)
 Electronic mail is often referred to as E-mail and it is a method used for exchanging digital messages.
Basics of E-Mail
 An email address: This is a unique identifier for each user, typically in the format of
mailid(localpart)@domainname.com.

 An email client: This is a software program used to send, receive and manage emails, such as
Gmail, Outlook, or Apple Mail.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

 An email server: This is a computer system responsible for storing and forwarding emails to
their intended recipients.
 The Person who sends the email is referred to as the Sender while the person who receives an
email is referred to as the Recipient.

Advantages
 Electronic mail is mainly designed for human use.
 It allows one message to be sent to one or more than one recipient.
 Ability to send and receive attachments such as documents, images, and videos.
 Easy to store and search for past messages.
 Cost-effective compared to traditional mail and fax.
 Available 24/7.

Components of E-mail System


The basic Components of an Email system are as follows:
1. User Agent (UA)
 It is a program that is mainly used to send and receive an email.
 It is also known as an email reader.
 User-Agent is used to compose, send and receive emails.
o It is the first component of an Email.
o User-agent also handles the mailboxes.
o The User-agent mainly provides the services to the user in order to make the sending
and receiving process of message easier.
 Given below are some services provided by the User-Agent:
1.Reading the Message
2.Replying the Message
3.Composing the Message
4.Forwarding the Message.
5.Handling the Message.
2. Message Transfer Agent
The actual process of transferring the email is done through the Message Transfer Agent(MTA).
 In order to send an Email, a system must have an MTA client.
 In order to receive an email, a system must have an MTA server.
 The protocol that is mainly used to define the MTA client and MTA server on the internet
is called SMTP(Simple Mail Transfer Protocol).
 The SMTP mainly defines how the commands and responses must be sent back.
3. Message Access Agent
In the first and second stages of email delivery, we make use of SMTP.
 SMTP is basically a Push protocol.
 The third stage of the email delivery mainly needs the pull protocol, and at this stage, the
message access agent is used.
 The two protocols used to access messages are POP and IMAP4.

Architecture of Email
The architecture of e-mail with the help of four scenarios:

1. First Scenario

 When the sender and the receiver of an E-mail


are on the same system, then there is the need
for only two user agents.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

2. Second Scenario
 In this scenario, the sender and
receiver of an e-mail are basically
users on the two different
systems.
 Also, the message needs to send
over the Internet.
 In this case, we need to make use
of User Agents and Message
transfer agents (MTA).

3. Third Scenario

 In this scenario, the sender is connected to


the system via a point-to-point WAN it can
be either a dial-up modem or a cable
modem.
 While the receiver is directly connected to
the system like it was connected in the
second scenario.
 Also in this case sender needs a User agent
(UA) in order to prepare the message.
 After preparing the message the sender sends
the message via a pair of MTA through LAN
or WAN.

4. Fourth Scenario

 In this scenario, the receiver is also


connected to his mail server with the help
of WAN or LAN.
 When the message arrives the receiver
needs to retrieve the message; thus there is
a need for another set of client/server
agents.
 The recipient makes use of MAA (Message
access agent) client in order to retrieve the
message.
 In this, the client sends the request to the
Mail Access agent (MAA) server and then
makes a request for the transfer of
messages.
 This scenario is most commonly used today.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Structure of Email

********
SMTP (Simple Mail Transfer Protocol )
 SMTP is short for Simple Mail Transfer Protocol.
 It is used for sending the emails efficiently and reliably over the internet.
Working-
 SMTP server is always on a listening mode.
 Client initiates a TCP connection with the SMTP server.
 SMTP server listens for a connection and initiates a connection on that port.
 The connection is established.
 Client informs the SMTP server that it would like to send a mail.
 Assuming the server is OK, client sends the mail to its mail server.
 Client’s mail server use DNS to get the IP Address of receiver’s mail server.
 Then, SMTP transfers the mail from sender’s mail server to the receiver’s mail server.

 While sending the mail, SMTP is used two times-


1. Between the sender and the sender’s mail server
2. Between the sender’s mail server and the receiver’s mail server
SMTP Methods:
 Store and Forward method: Within an organization, the store and forward approach is
utilized.
 End-to-End Method: The end-to-end technique is mostly used to communicate across
companies.

 An SMTP client is the one who wishes to send the email and will undoubtedly make direct contact with
the destination’s host SMTP in order to deliver the email to the destination.
 The SMTP server, on the other hand, will retain the email to itself until it is successfully duplicated to
the SMTP at the receiver. The SMTP server mostly responds to session requests.
 Thus, the client-SMTP initiates the session, and the server-SMTP responds to the sender’s request.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

NOTE-
To receive or download the email,
 Another protocol is needed between the receiver’s mail server and the receiver.
 The most commonly used protocols are POP3 and IMAP.

Characteristics of SMTP-
 SMTP is a push protocol.
 SMTP uses TCP at the transport layer.
 SMTP uses port number 25.
 SMTP uses persistent TCP connections, so it can send multiple emails at once.
 SMTP is a connection oriented protocol.
 SMTP is a stateless protocol.
********
POP Vs IMAP

S.NO Post Office Protocol (POP) Internet Message Access Protocol (IMAP)
IMAP allows you to check the mail content before
POP allows you to read the mail only after downloading.
1
downloading it. So, with IMAP you can choose to download your
messages or just delete them.
The email message is downloaded to the local The email message is stored on the mail server
2
computer and the copy at the server is deleted. itself.
The user cannot organize mails in the mail box
3 The user can organize mails on the server.
of the mail server.
Mails can only be accessed from a single Mails can be accessed from multiple devices
4
device. which is the biggest advantage.
In POP, the mail server and client’s mail In IMAP, the mail server and the client’s mail
account are not synced. account are synced.
So, changes made in the client’s mail account So, changes made in the client’s mail account are
are not visible on the web mail inbox. instantly visible on the web mail inbox.
Example-
5
If you are using POP and marks a mail as Example-
read, it does not get marked as read in the If you are using IMAP and marks a mail as read,
web mail inbox because the mails are it gets marked as read in the web mail inbox too
downloaded to the computer and so the because the changes are taking place on the
changes won’t be visible on the server. server.
IMAP is a stateful protocol because the IMAP server
POP is a stateful protocol until the mail is
6 has to maintain a folder hierarchy for each of its
downloaded as well as stateless across sessions.
users.
POP is a better choice for those who hardly IMAP is a better choice for those who frequently
7
checks their mail on any other computer. check their mails on other computers.
********
DNS (Domain Name Server)
 DNS - Domain Name Server
 DNS is an Internet service that translates domain names into IP addresses
 Domain or Domain name are easy to remember, it identifies the location of a website.
 Every time you use a domain name, a DNS service must translate the name to IP address.
Example:-

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Categories of DNS
 It divided into main three different categories in the internet.
 i.e., Generic domain, Country domain and Inverse domain
 Each node in tree defines a domain, which is an index to the domain name space database

1. Generic domain
Generic Domain Labels are follows:
 The generic domains define registered hosts
according to their generic behaviours.
 Labels in this first level or top level node have
these characters.
 The 3 character domain are called as generic
domain

2. Country domains:
 Labels in these nodes have only two characters
 Example
o us for United States
o in for India
o fr for France
o uk for United Kingdom
o ca for Canada

3. Inverse Domain

 Purpose of inverse domain is mapping an


address to a name.
 Servers that handles inverse domain are also
hierarchal.

Components of DNS
Name Space
 Name space maps each address to a unique name can be organized in two ways:
1. Flat Name Space
 It is a sequence of character
 There is no structure
 It is not supported in large number of PC’s in internet.
 It centrally controlled to avoid ambiguity and duplication.
2. Hierarchical Name Space
 It provides a flexible naming structure.
 The namespace is partitioned at the top level.
 Each name is made of several parts.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

Example:
sru.edu.in
sru is name
edu is nature organization (education purpose)

Name Server
 Root is a stand-alone node.
 The information in DNS is grouped under several
domains. These domains are the first level (sub
trees) in the hierarchy structure.
 Each domain is divided into sub-domains.
 Each server is responsible (authority) for large or
small domain called zone.
 The authority server maintains all information
(database) for every node in its domain, in a file
called zone file.

Name Resolver
 The resolver accesses the closest server or other servers to get the information for mapping.

DNS Architecture

 The client machine sends a request to the local OS machine.


 It transfer the control to DNS server which, if not find the address in its database(cache table),
sends a request to the root name server, which in turn, will route the query to an intermediate or
authoritative name server.
 The intermediate name server always knows who the authoritative name server is.
 So finally the IP address is returned to the local name server which in turn returns the IP address to the
Client.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

FTP (File Transfer Protocol )


 FTP is short for File Transfer Protocol.
 It is used for exchanging files over the internet.
 It establishes two connections between client and server. One for data connection and the other for
control information like commands and responses.
 It enables the users to upload and download the files from the internet.
 It uses TCP’s well known port 20 for data connection and 21 for control connection

Types of Connections in FTP:


There are 2 types of connections within the File Transfer Protocol:
1. Control Connection:
 FTP uses control connections to convey control information such as user identity, password,
commands to alter the remote directory, commands to fetch and save files, and so on.
 The control connection is established on port 21.
2. Data Connection:
 FTP uses a data connection to transfer the actual file.
 On port number 20, a data connection is established.
 Because it utilises a separate control connection, FTP sends control information out-of-band.
 Some protocols send request and response header lines, as well as data, over the same TCP
connection.
 As a result, they are said to convey control information in-band.
 HTTP and SMTP are two examples of such protocols.

Working of FTP:

 The control connection connects the control processes, whereas the data connection connects the
data transfer processes.
 The control connection is kept open during the FTP interactive session, whereas the data connection
is created and then closed for each file transmitted.
 Simply said, when a user initiates an FTP connection, the control connection opens; while it is
open, the data connection can be opened and closed numerous times if multiple files need to be
transmitted.

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.
Unit - 5 Computer Networks

CN Question Bank

Part - A
1. Mention the role of SMTP and how is it different from FTP?
2. Define Fire wall.
3. Define about IP Security architecture.
4. Define SNMP
5. What is POP?
6. What is DNS?
7. Define Plaintext and Cipher text.

Part - B
1. Define FTP. Discuss in brief about FTP.
2. Describe in brief about E-Mail.
3. Discuss about DNS in detail.
4. How authentication is achieved using Pretty Good Privacy (PGP) in application layer?
5. Explain how Authentication is provided based on the Shared secret key.
6. Discuss how SMTP works?

All The Best

Mr. Radhakrishnan Paramasivan., M.Tech (CSE)., M.C.A., M.B.A (HR)., M.Sc (Psychology)., B.lit (Tamil),M.A (Criminology ).,(Ph.D)
Assistant Professor, School of CS & AI, SR University.

You might also like