CN NOTES 1 To 5
CN NOTES 1 To 5
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
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.
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
Simplex mode
➢ Data is transmitted in one direction only(unidirectional)
➢ One device sends the data and other devices the data.
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
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
2. Reliability
o Accuracy in delivery
o Measured by network failures
3. Security
Protecting data from unauthorized access and viruses.
Computer Network
Advantage of Computer Network:-
➢ Increase speed
➢ Ease of accessibility
➢ Resource sharing
➢ Greater storage capacity
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
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.
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
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.
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
************
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.,
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.
***************
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
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.
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.
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
Disadvantages
The initial cost of installing LAN is quite high
Advantages Disadvantages
o Cost effective o Maintenance
o Easy Data Transfer o Limited connection
o Using the Internet Service Provider o Less speed
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.
➢ 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
**********
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.
➢ 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.
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
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.
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.
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)
➢ 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
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
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.
➢ 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:-
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.
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.
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.
Types of Modulation
1. Amplitude modulation
2. Frequency modulation
3. Phase modulation
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.
***************
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
****************
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
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.
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.
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
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.
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.
Types of Framing
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
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.
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.
*************
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.
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
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
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.
Example 1:
Original Message or Data word = 100100
Divisor = 1101
Example 2:
Location 7 6 5 4 3 2 1
Bit Designation D7 D6 D5 P4 D3 P2 P1
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
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
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:-
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)
**********
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.
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.
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.
4 . If the Acknowledgement of a frame is not received within an agreed upon time period, all frames in the
current window are retransmitted
2 . The receiver then slides the window over and sends the next frame in the queue.
3 . The receiver thus sends back a “NAK” signal or a non-acknowledgment to let the sender know
that frame 2 has been lost.
**********
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.
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.
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.
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)
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.
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
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.
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.
Frame Length
Minimum: 64 bytes (512 bits)
Maximum: 1518 bytes (12144 bits)
Ethernet Address
Example in hexadecimal notation
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:
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.
************
CN Question Bank
Part – A
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
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
****************
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.
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
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)
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-
➢ The encapsulated data is referred to as IP Payload. IP header contains all the necessary information to
deliver the packet at the other end.
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.
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
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
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.
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.
❖ 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.
❖ 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.
➢ 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
➢ 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.
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.
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
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
At Router C At Router 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.
Example
Given Problem Solution
****************
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
Loop Prevention :
Whenever a router sees its own AS number in the router update, it will drop and ignore it.
➢ 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.
***************
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.
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)
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
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
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
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.
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.
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.
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
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.
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
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 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
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
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.
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
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.
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.
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.
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
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
***********
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.
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.
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
Drawback
If the high priority data arrives continuously the low priority queue will not
get a chance to be processed. So starvation occurs.
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.
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
*********
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
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
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
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:
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.
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.
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)
**********
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
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
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
************
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.
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
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
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.
Architecture of Email
The architecture of e-mail with the help of four scenarios:
1. First Scenario
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
4. Fourth Scenario
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.
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
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
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
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?
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.