0% found this document useful (0 votes)
37 views68 pages

Study Materials

The document outlines the study material for the Computer Networking course at the University of Engineering and Management, detailing course objectives and outcomes, as well as a structured lecture plan covering various networking topics. Key areas include network architecture, OSI model layers, data transmission modes, network topologies, and security measures. Learning resources are also provided to support the curriculum.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views68 pages

Study Materials

The document outlines the study material for the Computer Networking course at the University of Engineering and Management, detailing course objectives and outcomes, as well as a structured lecture plan covering various networking topics. Key areas include network architecture, OSI model layers, data transmission modes, network topologies, and security measures. Learning resources are also provided to support the curriculum.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

University of Engineering and Management

Institute of Engineering & Management, Salt Lake Campus Institute of Engineering &
Management, New Town CampusUniversity of Engineering & Management, Jaipur

Study Material
Subject Name: Computer Networking
Subject Code: BCAMD301
COURSE OBJECTIVES:
1. To deliver comprehensive view of Computer Network.
2. To enable the students to understand the Network Architecture, Network type and
topologies.
3. To understand the design issues and working of each layer of OSI model.
4. To familiarize with the benefits and issues regarding Network Security.
COURSE OUTCOMES:
CO1: Identify the different components in a Communication System and their respective roles.
CO2 Describe the technical issues related to the Networks.
CO3: Defining the standard model and protocols of networking
CO4: Understand the basics of data communication, networking, internet and their importance.

Lecture
Module Topic Sub-topics
Hours
number
1 Introduction Introduction to communication systems, 5
Data, signal and Transmission: Analog and Digital,
Transmission modes,
components, Transmission Impairments, Performance
criteria of a communication system. Goals of computer
Network, Networks: Classification, Components and
Topology, categories of network
[LAN, MAN,WAN];Internet: brief history, internet today;
Protocols and standards; OSI and TCP/IP model.
2 Physical Layer & Physical Layer: 10
Data link layer Overview of data[analog & digital], signal[analog &
digital],
transmission [analog & digital] & transmission media
[guided
& unguided]; Circuit switching: time division & space
division
switch, TDM bus; Telephone Network

Data link layer:


Types of errors, framing [character and bit stuffing], error
detection
& correction methods; Flow control; Protocols: Stop &
wait ARQ
Medium access sub layer:
Point to point protocol, FDDI, token bus, token ring;
Reservation, polling, concentration; Multiple access
protocols: ALOHA, CSMA,FDMA, TDMA, CDMA;
Ethernet
3 Network layer & Network layer: 10
Transport layer: Internetworking & devices: Repeaters, Hubs, Bridges,
Switches,
Router, Gateway; Addressing : Internet address, Classful
address,
Routing: techniques, static vs. dynamic routing ,
Protocols: IP, IPV6.
Transport layer: Process to process delivery; UDP; TCP;
Congestion control algorithm: Leaky bucket algorithm,
Token bucket algorithm, Quality of services [Qos]
4 Application Layer Application Layer 10
DNS, SMTP, FTP, HTTP & WWW

5 Network Security Security: Cryptography 5


[Public, Private Key based], Digital Signature, Firewalls
[technology & applications]

Learning Resource:

1. Data Communications and Networking, B. A. Forouzan,TMH.


2. Computer Networks, A. S.Tanenbaum, Pearson Education/PHI.
3. Data and Computer Communications, W. Stallings, PHI/Pearson Education.
Module-1: Introduction
1. Data Communication: A network is a set of devices (often referred to as nodes) connected by
communication links. A node can be a computer, printer, or any other device capable of sending
and/or receiving data generated by other nodes on the network.

2. Component of Data Communication:

Message: The message is the information (data) to be communicated. Popular forms of information include
text, numbers, pictures, audio, and video.
Sender: The sender is the device that sends the data message. It can be a computer, workstation, telephone
handset, video camera, and so on.
Receiver: The receiver is the device that receives the message. It can be a computer, workstation, telephone
handset, television, and so on.
Transmission medium: The transmission medium is the physical path by which a message travels from
sender to receiver. Some examples of transmission media include twisted-pair wire, coaxial cable, fiber-
optic cable, and radio waves

Protocol: A protocol is a set of rules that govern data communications. It represents an agreement between
the communicating devices. Without a protocol, two devices may be connected but not communicating, just
as a person speaking French cannot be understood by a person who speaks only Japanese.

3. Network: A network is a set of devices (often referred to as nodes) connected by communication


links. A node can be a computer, printer, or any other device capable of sending and/or receiving
data generated by other nodes on the network.
4. Advantages of Computer Networks

 File sharing: The major advantage of a computer network is that is allows file sharing and
remote file access.
 Resource sharing: All computers in the network can share resources such as printers, fax
machines, modems, and scanners.

 Better connectivity and communications: It allows users to connect and communicate with each
other easily.
 Flexible access: A user can log on to a computer anywhere on the network and access his files.

 Instant and multiple accesses: Computer networks are multiply processed .many of users can
access the same information at the same time.
5. Network Criteria :
 Performance:
Performance can be measured in many ways, including transit time and response time. Transit time is the
amount of time required for a message to travel from one device to another. Response time is the elapsed
time between an inquiry and a response. The performance of a network depends on a number of factors,
including the number of users, the type of transmission medium, the capabilities of the connected
hardware, and the efficiency of the software.
 Reliability:
In addition to accuracy of delivery, network reliability is measured by the frequency of failure, the time it
takes a link to recover from a failure, and the network's robustness in a catastrophe.

 Security:
Network security issues include protecting data from unauthorized access, protecting data from damage
and development, and implementing policies and procedures for recovery from breaches and data losses.

6. Data Transmission Mode


Simplex: In simplex mode, the communication is unidirectional, as on a one-way street. Only one of the
two devices on a link can transmit.

Half-Duplex: In half-duplex mode, each station can both transmit and receive, but not at the same time.
When one device is sending, the other can only receive, and vice versa the half-duplex mode is like a one-
lane road with traffic allowed in both directions.

Full-Duplex: In full-duplex both stations can transmit and receive simultaneously. The Full-duplex Mode
is like a two-way street with traffic flowing in both directions at the same time. In this mode of
transmission two people are communicating by a telephone line, both can talk and listen at the same time.
7. Type of Network Connection
8. Different types of Network Topology: The topology of a network is the geometric representation of
the relationship of all the links and linking devices (usually called nodes) to one another.

A. Mesh Topology: In a mesh topology, every device has a dedicated point-to-point link to every other
device. The term dedicated means that the link carries traffic only between the two devices it
connects. n other words, we can say that in a mesh topology, we need n(n -1) /2 duplex-mode links.

Advantages:

 The use of dedicated links guarantees that each connection can carry its own data load, thus
eliminating the traffic problems that can occur when links must be shared by multiple devices.
 A mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire
system.
 There is the advantage of privacy or security. When every message travels along a dedicated line,
only the intended recipient sees it.

Disadvantages:
 Disadvantage of a mesh are related to the amount of cabling because every device must be
connected to every other device, installation and re connection are difficult.
 The sheer bulk of the wiring can be greater than the available space (in walls, ceilings, or floors)
can accommodate.
 The hardware required to connect each link (I/O ports and cable) can be prohibitively expensive.

B. Star Topology: In a star topology, each device has a dedicated point-to-point link only to a central
controller, usually called a hub. The devices are not directly linked to one another. Unlike a mesh
topology, a star topology does not allow direct traffic between devices.
Advantages:

 A star topology is less expensive than a mesh topology. In a star, each device needs only one link
and one I/O port to connect it to any number of others. This factor also makes it easy to install
and reconfigure.
 Far less cabling needs to be housed, and additions, moves, and deletions involve only one
connection: between that device and the hub.
 Other advantages include robustness. If one link fails, only that link is affected. All other links
remain active.
Disadvantages:

 One big disadvantage of a star topology is the dependency of the whole topology on one single
point, the hub. If the hub goes down, the whole system is dead.
 Although a star requires far less cable than a mesh, each node must be linked to a central hub.
For this reason, often more cabling is required in a star than in some other topologies (such as
ring or bus).
C. Bus Topology: The preceding examples all describe point-to-point connections. A bus topology, on
the other hand, is multipoint. One long cable acts as a backbone to link all the devices in a network.

Advantages:

 Ease of installation.
 A bus uses less cabling than mesh or star topologies.
 In a star, for example, four network devices in the same room require four lengths of cable
reaching all the way to the hub. In a bus, this redundancy is eliminated.
Disadvantages:

 Difficult re connection and fault isolation.


 Signal reflection at the taps can cause degradation in quality. This degradation can be controlled
by limiting the number and spacing of devices connected to a given length of cable.
 It can therefore be difficult to add new devices. Adding new devices may therefore require
modification or replacement of the backbone.
D. Ring Topology: In a ring topology, each device has a dedicated point-to-point connection with only
the two devices on either side of it. A signal is passed along the ring in one direction, from device to
device, until it reaches its destination.

Advantages:

 A ring is relatively easy to install and reconfigure. Each device is linked to only its immediate
neighbors.
 To add or delete a device requires changing only two connections is very easy.
 Less cable used.

Disadvantages:

 A Unidirectional traffic can be a disadvantage.


 In a simple ring, a break in the ring (such as a disabled station) can disable the entire network.
This weakness can be solved by using a dual ring or a switch capable of closing off the break.
E. Hybrid Topology:

9. Category of Networks:
A. Local Area Network (LAN): A local area network (LAN) is usually privately used to connect the
devices in a single office, building, or campus. LAN provides a useful way of sharing the resources
between end users. The resources such as printers, file servers, scanners, and internet are easily
sharable among computers.

B. The Metropolitan Area Network (MAN): It generally expands throughout a city such as cable TV
network. It can be in the form of Ethernet, Token-ring, ATM, or Fiber Distributed Data Interface
(FDDI). Backbone of MAN is high-capacity and high-speed fiber optics. MAN works in between
Local Area Network and Wide Area Network.
C. Wide Area Network (WAN): It covers a wide area which may span across provinces and even a
whole country. Generally, telecommunication networks are Wide Area Network. These networks
provide connectivity to MANs and LANs.
10. Transmission Impairment: When signals travel through the medium, the signal can be deteriorate
due to various regions which are known as transmission impairment. There are various regions for
transmission impairment discus given bellow:
a. Attenuation: Here the signal passes through the medium, it tends to get weaker. As it covers
distance, it loses strength.
b. Delay distortion: Here sender and receiver data sending and receiving speed not same.
c. Noise: Any kind of noise can be destroying the band width of original signal.
d. Crosstalk: Due to miss match of two or more different signal.
e. Impulse: This is introduced because of irregular disturbances such as lightening, electricity, short-
circuit etc.

11. Layered Tasks:

12. Open System Interconnection (OSI) Model: Open System Interconnect is an open standard for all
communication systems. OSI model is established by International Standard Organization (ISO).
This model has seven layers:
I. Physical Layer (Layer 1): The lowest layer of the OSI reference model is the physical layer. It is
responsible for the actual physical connection between the devices. The physical layer contains
information in the form of bits.

The functions of the physical layer are:

 Bit synchronization: The physical layer provides the synchronization of the bits by providing a
clock. This clock controls both sender and receiver thus providing synchronization at bit level.

 Bit rate control: The Physical layer also defines the transmission rate i.e. the number of bits sent
per second.
 Physical topologies: Physical layer specifies the way in which the different, devices/nodes are
arranged in a network i.e. bus, star or mesh topology.
 Transmission mode: Physical layer also defines the way in which the data flows between the two
connected devices. The various transmission modes possible are: Simplex, half-duplex and full
duplex.
II. Data Link Layer (DLL) (Layer 2): The data link layer is responsible for the node to node delivery
of the message. It always deals with Data Frame.

The functions of the data Link layer are:

 Framing: Framing is a function of the data link layer. It provides a way for a sender to transmit a
set of bits that are meaningful to the receiver. This can be accomplished by attaching special bit
patterns to the beginning and end of the frame.
 Physical addressing: After creating frames, Data link layer adds physical addresses (MAC
address) of sender and/or receiver in the header of each frame.

 Error control: Data link layer provides the mechanism of error control in which it detects and
retransmits damaged or lost frames.

 Flow Control: The data rate must be constant on both sides else the data may get corrupted thus
, flow control coordinates that amount of data that can be sent before receiving acknowledgement.

 Access control: When a single communication channel is shared by multiple devices, MAC sub
layer of data link layer helps to determine which device has control over the channel at a given
time.

III. Network Layer (Layer 3): Network layer works for the transmission of data from one host to the
other located in different networks. It also takes care of packet routing i.e. selection of shortest
path to transmit the packet, from the number of routes available.
The functions of the Network layer are:

 Routing: The network layer protocols determine which route is suitable from source to
destination.
 Logical Addressing: In order to identify each device on internet uniquely, network layer defines
an addressing scheme. Such an address distinguishes each device uniquely and universally.

IV. Transport Layer: The transport layer is responsible for process-to-process delivery of the entire
message. A process is an application program running on a host. It ensures that the whole
message transmitted in order from sender to receiver. A connection oriented transport layer
makes a connection with the transport layer at the destination machine first before delivering the
packets. After all the data are transferred, the connection is terminated.

V. Session Layer:
 Dialog control. The session layer allows two systems to enter into a dialog. It allows the
communication between two processes to take place in either half duplex (one way at a time) or
full-duplex (two ways at a time) mode.
 Synchronization: The session layer allows a process to add checkpoints, or synchronization points,
to a stream of data.

VI. Presentation Layer: The presentation layer is concerned with the syntax and semantics of the
information exchanged between two systems.

 Translation: Different computers use different encoding systems, the presentation layer is
responsible for inter operation between these different encoding methods.
 Encryption: To carry sensitive information, a system must be able to ensure privacy. Encryption
means that the sender transforms the original information to another form and sends the
resulting message out over the network. Decryption reverses the original process to transform the
message back to its original form.
 Compression: Data compression reduces the number of bits contained in the information. Data
compression becomes particularly important in the transmission of multimedia such as text,
audio, and video.
VII. Application Layer: It provides user interfaces and support for services such as electronic mail,
remote file access and transfer. This application allows a user to retrieve files from a remote
computer. It also responsible e-mail forwarding and storage.

13. Different type of switching technique


Switching is a mechanism by which data/information sent from source towards destination which are not
directly connected. Networks have interconnecting devices, which receives data from directly connected
sources, stores data, analyze it and then forwards to the next interconnecting device closest to the
destination.
a. Circuit Switching:

b. Message Switching: It is nothing but sore and forward technique. Here first receives the whole
message and buffers it until there are resources available to transfer it to the next hop. It is not
suitable because here transit path needs enough storage and hence it is very slow.

c. Packet Switching: Here each packet is routed independently through the network. Therefore
packets contain a header with the full information about the destination. The individual packets
which form a data stream may follow different paths between the source and the destination.

SKFGI/CSE
Different Component of Networking
A. Switch: A switch, in the context of networking is a high-speed device that receives incoming data
packets/frames and redirects them to their destination on a local area network (LAN). A LAN
switch operates at the data link layer (Layer 2). Switch is used to node-to-node communication on
the same network.

B. Router: A router is a networking device that forwards data packets between


computer networks. Routers perform the traffic directing functions on the Internet Then,
using information in its routing table or routing policy, it directs the packet to the next network on its
journey.

C. HUB: a hub is the most basic networking device that connects multiple computers or other
network devices together. Unlike a network switch or router, a network hub has no routing tables.
The hub contains multiple ports which work in Physical layer.
D. Bridge: A bridge works at the Data link layer (Layer 2) of the OSI model. It responsible to
transmit frames one host to another into two different LAN.
E.

Sample questions (Module-1)

1. State advantages of star topology(CO2,BL-4)


2. Compare and contrast between bus and ring topology(CO2,BL5)
3. Explain mesh topology(CO2,BL4)
4. Differentiate between hub, bridge and router(CO2,BL6)

Module-2: Physical Layer & Data link layer


1. TCP/IP Reference Model

Internet model contain four layered architecture. OSI Model is general communication model but
Internet Model is what the internet uses for all its communication.

Application Layer: This layer defines the protocol which enables user to interact with the network.
For example, FTP, HTTP etc.
Transport Layer: This layer defines how data should flow between hosts. Major protocol at this
layer is Transmission Control Protocol (TCP). This layer ensures data delivered between hosts is in-
order and is responsible for end-to-end delivery.

Internet Layer: Internet Protocol (IP) works on this layer. This layer facilitates host addressing and
recognition. This layer defines routing.

Link Layer: This layer provides mechanism of sending and receiving actual data. This layer is
based on network architecture and hardware.

2. Analog-to-Digital Conversion (Sampling, Quantization and Encoding)


3. Line Encoding
The process for converting digital data into digital signal is said to be Line Encoding. Digital data can
transmit as a form of 0 or 1.

Category of Line coding

I. Uni-polar Encoding:
Unipolar encoding schemes use single voltage level to represent data. In this case, to represent binary 1,
high voltage is transmitted and to represent 0, no voltage is transmitted. It is also called Unipolar-Non-
return-to-zero.
II. Polar Encoding:
Polar encoding scheme uses multiple voltage levels to represent binary values. Polar encodings is
available in four (4) types.

A. Polar Non Return to Zero (Polar NRZ)


It uses two different voltage levels to represent binary values. Generally, positive voltage represents 1 and
negative value represents 0. NRZ scheme has two variants: NRZ-L and NRZ-I. NRZ-L changes voltage
level at when a different bit is encountered whereas NRZ-I changes voltage when a 1 is encountered.

B. Return to Zero (RZ)


Problem with NRZ is that the receiver cannot conclude when a bit ended and when the next bit is started,
in case when sender and receiver’s clock are not synchronized.
C. Manchester

This encoding scheme is a combination of RZ and NRZ-L. Bit time is divided into two halves. It transits
in the middle of the bit and changes phase when a different bit is encountered.

D. Differential Manchester

This encoding scheme is a combination of RZ and NRZ-I. It also transits at the middle of the bit but
changes phase only when 1 is encountered.
III. Bipolar Encoding

Bipolar encoding uses three voltage levels, positive, negative, and zero. Zero voltage represents binary 0
and bit 1 is represented by altering positive and negative voltages.

4. Time Division Multiplexing


In TDM the shared channel is divided among its user by means of time slot. Each user can transmit data
within the provided time slot only. Digital signals are divided in frames, equivalent to time slot
i.e. frame of an optimal size which can be transmitted in given time slot.
5. Transmission Media
Data is represented by computers and other telecommunication devices using signals. Signals are
transmitted in the form of electromagnetic energy from one device to another.

Un shielded Twisted Pair Cable

It is the most common type of telecommunication when compared with Shielded Twisted Pair Cable
which consists of two conductors usually copper, each with its own color plastic insulator. 2 pair uses RJ-
11 connector and 4 pair cable uses RJ-45 connector for UTP. Its limit is 100m ,relatively cheap and low
bandwidth than coaxial cable.
Shielded Twisted Pair Cable

This cable has a metal foil or braided-mesh covering which encases each pair of insulated conductors.
Electromagnetic noise penetration is prevented by metal casing. Use for LAN.

Coaxial Cable

Coaxial is called by this name because it contains two conductors that are parallel to each other. Copper
is used in this as centre conductor which can be a solid wire or a standard one.

Coaxial Cable Standards Coaxial Cable Connectors


Fiber Optics

Fiber optic cable uses electrical signals to transmit data. It transmits data in the form of light. In the
center of fiber cable is a glass stand or core. The light from the laser moves through this glass to the other
device around the internal core is a reflective material known as cladding.

Unguided Media

Wireless transmission is a form of unguided media. Wireless communication involves no physical link
established between two or more devices, communicating wirelessly. Wireless signals are spread over in
the air and are received and interpreted by appropriate antennas. Antenna converts the digital data into
wireless signals and spread all over within its frequency range.
Radio Transmission

Radio frequency is easier to generate and because of its large wavelength it can penetrate through walls.
Radio waves can have wavelength from 1m – 100 km and have frequency ranging from 3KHz (Extremely
Low Frequency) to 1 GHz (Extremely High Frequency).

Low frequency Radio Wave High frequency Radio Wave

Microwave Transmission

Electromagnetic waves having frequencies between 1 GHz to 300 GHz are called micro waves. Micro
waves are unidirectional. Microwaves travels in straight lines and travels in straight lines. So here the
sending and receiving antennas need to be aligned.
Satellite Microwave (Satellite communication)

This is a microwave relay station which is placed in outer space. These are positioned 36000 Km above
the equator with an orbit speed that exactly matches the rotation speed of the earth. This is usually done
to allow ground stations to aim antenna at a fixed point in the sky.
Data Link Layers
Data link Layer responsible to transmit the frame. A frame is nothing but some set of bit stream.

Types of Errors in Frame:

6. Error Detection

The bit stream transmitted by the physical layer is not guaranteed to be error free. The data link layer is
responsible for error detection and correction. I n this method some extra bit (s) added to the original
data word which are transmitted over the network.

Techniques for error detection:

I. Parity checks
II. Check sum methods
III. Cyclic redundancy checks
I. Even parity checking scheme

In Even parity checking scheme if the number of 1’s in the data word is odd number then an extra
redundant bit 1 add with the data word to make code word otherwise add 0 as a redundant bit.
II. Cyclic Redundancy Check (CRC)

CRC is a different approach to detect if the received frame contains valid data. This technique involves
binary division of the data bits being sent. The divisor is generated using polynomials. The sender
performs a division operation on the bits being sent and calculates the remainder. If there is n bits in
divisor the redundant bit will be n-1. Before sending the actual bits, the sender adds the remainder at the
end of the actual bits. Actual data bits plus the remainder is called a codeword. The sender transmits data
bits as codeword.
Sender Side
Receiver Side

Check sum method: Here K= No. of frame and N= No. of bits in each

1. Error Detection using Hamming Code:


This method corrects the error by finding the state at which the error has occurred.
For example If 7 bit Data transmits the required redundant bit will be 4 on the basis of following formula.
 2r > m + r + 1 Where m=No. of bits in Data word and r= No of redundant bit.
 24> 7 + 4 + 1
Redundant bits add on following position on the basis power of 2 (i.e 20=1,21=2,22=4,23=8 )

 r1 : bits 1,3,5, 7, 9, 11 (r1 take the bits one after another)


 r2 : bits 2, 3, 6, 7, 10, 11 (r2 takes consecutive 2 bits and then 2 bits after 2 bits)
 r4 : bits 4, 5, 6, 7 (r4 takes 4 bits starting from r4)
 r8 : bits 8, 9, 10, 11 ( r8 takes 8 bits starting from r8)
For example If we want to transmit the data word 1001101. How we add the 4 redundant bits.

Data word =

Add r1=

Add r2 =

Add r4 =

Add r8= Code Word


Sent Data = Received data= 1 0 0 1 1 1 0 0 1 0 1
Error detection methods in receiver side :
 r1 : bits 1,3,5,1 7, 9, 110 0 1 0 1 0 0 1 0 1
 r2 : bits 2, 3, 6, 7, 10, 11
 r4 : bits 4, 5, 6, 7
 r8 : bits 8, 9, 10, 11
2. Flow Control

Flow control occur when a data frame (Layer-2 data) is sent from one host to another over a single medium, it is
required that the sender and receiver should work at the same speed. That is, sender sends at a speed on which the
receiver can process and accept the data.

i. Stop and Wait (Normal Condition for Noise less channel)

ii. Stop and Wait ARQ (Automatic Repeat Requests) for Noise channel: Lost ACK
Lost Frame

Delay ACK
iii. Go-Back-N ARQ

Normal Operation Go-Back-N ARQ


Lost ACK in Go-Back-N ARQ

3. Time Division Multiple Access


Suppose the channel supports N nodes and the transmission rate of the channel is R bps , TDM divides time
into time slot for N nodes. Each time slot is then assigned to one of the N nodes. Each node gets a dedicated
transmission rate of R/N bps during each frame time.

TDM

1 2 3 4 1 2 3 4 1 2 3 4

Time Slot Frame


i. Pure ALOHA
Systems in which multiple users share a common channel and pure ALOHA allows users to transmit data
whenever they want. Hence possibility of the collision occurred can be high. If collision occurs, each station
involved waits a random amount of time.

ii. Slotted ALOHA


Slotted ALOHA was invented to improve the efficiency of pure ALOHA as chances of collision in pure ALOHA
are very high. In slotted ALOHA, the time of the shared channel is divided into fixed intervals slots. The stations
can send a frame only at the beginning of the slot and only one frame is sent in each slot. Here if any station is not
able to place the frame onto the channel at the beginning of the slot, the station has to wait until the beginning of
the next time slot.
iii. Carrier Sense Multiple Access (CSMA)
Here if any station want to transmit the data to other station, it first listens to the channel to see if anyone else is
transmitting at that moment. If the channel is busy, the station waits until it become free. Here a station detect the
channel is idle or not, if idle it transmits a frame. If a collision occurs, the station waits a random amount of time
and starts all over again.

CSMA
In CSMA When a station has data to send, it first listens to the channel to see if anyone else is transmitting at that
moment, If the channel is busy, the station waits until it become free. If the station detects an idle channel, it
transmits a frame. If a collision occurs, the station waits a random amount of time. Here 1-persistent protocol
which monitor the channel and transmit the frame to check the idle condition of the channel. However, if it finds
the channel is busy, it continuously senses the channel until it become free. The performance of this protocol is
affected by propagation delay.

 CSMA/CD

The basic idea behind CSMA/CD is that a station needs to be able to receive while transmitting to detect a
collision. When there is no collision, the station receives one signal: its own signal. When there is a collision, the
station receives two signals: its own signal and the signal transmitted by a second station.
 CSMA/CA

Here the station uses any of the persistent method to sense the channel. If the channel is busy , it again sense
the channel. The station continues to do so until it finds the station idle. After the station has found the
channel idle it does not send the frame immediately rather it waits for random amount of time which known
as Inter Frame Space (IFS). The station is required to wait for IFS time because it may happen that some
station has already started the transmission of the frame.
Sample Questions(Module-2)

1. Represent the following bit stream: 1 0 1 1 0, with Unipolar NRZ scheme.(CO3,BL5)


2. Represent the following bit stream: 0 1 0 0 1 with Polar RZ scheme.(CO3,BL5)
3. Explain CRC with an example (CO4, BL4).
4. What is hamming code (CO4, BL5).

Module-3: Network layer &Transport layer

Network Layer

The network layer is responsible for the delivery of individual packets from the source to the
destination host. The network layer adds a header that includes the logical addresses of the sender and
receiver to the packet coming from the upper layer. If a packet travels through the Internet, we need
this addressing system to help identify the source and destination.

Logical Address:

The packet transmitted by the sending computer may pass through several LANs or WANs before
reaching the destination computer. In this situation we need a global addressing scheme called logical
addressing.

 The Internet addresses are 32 bits in length; this gives us a maximum of 232 addresses.
These addresses are referred to as IPv4 (IP version 4) addresses or simply IP addresses.

 The new generation of IP or IPv6 (IP version 6) can accommodate more addresses. In this
version, the Internet uses 128-bit addresses that give much greater flexibility in address
allocation.

IPV4 Addressing

An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device to
the Internet. IPv4 addresses are unique. They are unique, which means two devices on the Internet can
never have the same address at the same time. The IPv4 addresses are universal in the sense that the
addressing system must be accepted by any host that wants to be connected to the Internet.

IPv4 uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296 (more than 4
billion).

Notation: In binary notation, the IPv4 address is displayed as 32 bits or a 4-byte address.
Here each byte (octet) is 8 bits, each number in dotted-decimal notation is a value ranging from 0 to
255.
Classful Addressing

In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Each class
occupies some part of the address space. We can find the class of an IP address of a given binary
notation or dotted-decimal notation. If the address is given in binary notation, the first few bits can tell
us the class of the address. If the address is given in decimal-dotted notation, the first byte (First 8
bits) defines the class.

In classful addressing, an IP address in class A, B, or C is divided into netid and hostid. These parts
are of varying lengths, depending on the class of the address.

Class-A: Class A addresses were designed for large organizations with a large number of attached
hosts or routers. Class A block is too large for any organization. Net ID 8 bits and host ID 24 bits.

Class-B: Class B addresses was designed for midsize organizations with tens of thousands of attached
hosts or routers. Net ID 16 bits and host ID 16 Bits.

Class-C: Class C addresses were designed for small organizations with a small number of attached
hosts or routers. A block in class C is probably too small for many organizations. Net ID 24 bits and
Host ID 8 Bits.

Class-D: Class D addresses were designed for multicasting. Each address in this class is used to
define one group of hosts on the Internet. The Internet authorities wrongly predicted a need for
268,435,456 groups.

Class-E: Class E addresses were reserved for future use. It is basically use for Broadcast.
 Sub-netting

If an organization was granted a large block in class A or B, it could divide the addresses into several
contiguous groups and assign each group to smaller networks called sub-nets.

 Super-netting

The size of a class C block with a maximum number of 256 addresses did not satisfy the needs of
most organizations. Even a midsize organization needed more addresses. One solution was super-
netting. In super-netting, an organization can combine several class C blocks to create a larger range
of addresses. In other words, several networks are combined to create a super network or a super net.
For example, an organization that needs 1000 addresses can be granted four contiguous class C
blocks.
IPV6 Addressing:

An IPv6 address consists of 16 bytes (octets); it is 128 bits long. To make addresses more readable,
lPv6 specifies hexadecimal colon notation. In this notation, 128 bits is divided into eight sections,
each 2 bytes in length. Two bytes in hexadecimal notation requires four hexadecimal digits.
Therefore, the address consists of 32 hexadecimal digits, with every four digits separated by a
colon.
Network Routing

When a device has multiple paths to reach a destination, it always selects one path by preferring it
over others. This selection process is termed as Routing. Routing is done by special network
devices called routers. Router is responsible to forward a packet to proper destination with the help
of proper routing algorithm by maintaining the information into a routing table.
1. Unicast routing
Routing unicast data over the internet is called unicast routing. It is the simplest form of routing
because the destination is already known. Hence the router just has to look up the routing table and
forward the packet to next hop.

2. Broadcast routing

A router creates a data packet and then sends it to each host one by one. In this case, the router
creates multiple copies of single data packet with different destination addresses. This method
consumes lots of bandwidth as here the entire router in the network system receives a packet that is
to be broad casted, it simply floods those packets out of all interfaces.
3. Multicast Routing
Multicast routing is special case of broadcast routing. But in Multicast routing, the data is sent to
only nodes which wants to receive the packets. Here a group of receiver receives packets from one
specific sender.

Packet forwarding and routing technique in Network Layer:

Packet forward: Packet forwarding means to place the packet in its route to its destination. In this
technique when a router has received a packet to be forwarded, it looks at this table to find the
route to the final destination. Several technique use to manage the size of routing table and also
provide the security.

Next-Hop Method: In this technique, the routing table holds only the address of the next hop
instead of information about the complete route (route method). The entries of a routing table must
be consistent with one another.
Routing Table

A host or a router has a routing table with an entry for each destination, or a combination of
destinations, to route IP packets. The routing table can be either static or dynamic.
There are two type of routing table.

i. Static Routing Table


ii. Dynamic Routing Table

i. Static Routing Table


A static routing table contains information entered manually. The administrator enters the route for
each destination into the table. When a table is created, it cannot update automatically when there
is a change in the Internet. The table must be manually altered by the administrator. A static routing
table can be used in a small internet that does not change very frequently. It is poor strategy to use
a static routing table in a big internet.

ii. Dynamic Routing Table


A dynamic routing table is updated periodically by using one of the dynamic routing protocols such
as RIP, OSPF, or BGP. Whenever there is a change in the Internet, such as a shutdown of a router
or breaking of a link, the dynamic routing protocols update all the tables in the routers
automatically.
Routing Protocols
Different Types of Routing Algorithm

i. The Distance-Vector (DV) Routing Algorithm (Bellman-Ford Algorithm)


In distance vector routing, the least-cost route between any two nodes is the route with minimum
distance. In this protocol, as the name implies, each node maintains a vector (table) of minimum
distances to every node. It is distributed process. In the distributed process each node receives some
information from one or more of its directly attached neighbour, performs a calculation, and then
distributes the results of its calculation back to its neighbour.

ii. Link-State (LS) Routing Algorithm (Dijkstra’s algorithm)


In link state routing, if each node in the domain has the entire topology of the domain the list of
nodes and links, how they are connected including the type, cost (metric), and condition of the
links (up or down)-the node can use Dijkstra's algorithm to build a routing table. Here formation of
a shortest path tree for each node is required.
iii. Path Vector Routing:
Path vector routing proved to be useful for inter domain routing. The principle of path vector routing

is similar to that of distance vector routing. In path vector routing one node in each autonomous
system acts as a communicating node on behalf of the entire autonomous system (AS). Let us call it
the speaker node. The speaker node in an AS creates a routing table and advertises it to speaker nodes
in the neighboring ASs. The idea is the same as for distance vector routing except that only speaker
nodes in each AS can communicate with each other. A speaker node advertises the path, not the
metric of the nodes, in its autonomous system or other autonomous systems.

OSPF (Open Shortest Path First)

The Open Shortest Path First or OSPF protocol is an intra-domain routing protocol based on link state
routing.

The Internet is made up of a large number of Autonomous Systems (AS). A routing algorithm within an
AS is called an interior gateway protocol and an algorithm for routing between AS is called an exterior
gateway protocol. OSPF allows them to be divided some areas, where an area is a network. An area is a
generalization of a subnet. Every AS has a backbone area. All areas are connected to the backbone, so it is
possible to go from any area in the AS to any other area in the AS via the backbone. Each router contains
a database. Its main job is to calculate the shortest path from itself to every other router in the area,
including the router that is connected to the backbone.
Path Vector Routing

Distance vector and link state routing are both intra-domain routing protocols. They can be used inside an
autonomous system, but not between autonomous systems. These two protocols are not suitable for inter-
domain routing mostly because of scalability. Both the routing algorithms are not suitable when the
domain of operation becomes large. Distance vector routing is subject to instability if there are more than
a few hope in the domain of operation. Link state routing needs a huge amount of resources to calculate
routing tables. It also creates heavy traffic because of flooding. There is a need for a third routing protocol
which we call path vector routing. Path vector routing proved to be useful for inter-domain routing. The
principle of path vector routing is similar to that of distance vector routing, In path vector routing, we
assume that there is one node in each autonomous system that acts on behalf of the entire autonomous
system. Let us call it the speaker node. The speaker node in an AS creates a routing table and advertises it
to speaker nodes in the neighboring ASs. The idea is the same as for distance vector routing except that
only speaker nodes in each AS can communicate with each other. However, what is advertised is
different. A speaker node advertises the path, not the metric of the nodes, in its autonomous system or
other autonomous systems.

Comparison between RIP OSPF and BGP

RIP OSPF BGP


RIP is intra domain routing OSPF is also intra domain It is inter domain routing
protocol used within the routing protocol used within the protocol used between the
autonomous system autonomous system autonomous system
RIP is used for Small networks OSPF is used in large The BGP protocol is used for
with maximum number of hops autonomous system with no very large-scale networks
16 limitation
RIP uses Distance Vector OSPF uses Link State BGP uses Path Vector
RIP send entire routing update to OSPF send multicast Hello BGP send Open packet to the
all directly connected interface packet to the neighbors, to create neighbors to create session
session
Transport Layer

The Transport layer is the fourth layer in the OSI model, which provides communication services
between the computers connected in the network. The transport layer provides an error checking service
during the transmission of data packets from source computer to destination computer. The transport layer
helps to carry out the process-to-process delivery i.e. the delivery of a packet or part of message from one
process to another process.

Three - Way Handshaking

The Three - Way Handshaking protocol is used to establish connection between two TCPs. The steps are

 A client sends a initialize the communication (SYN) data packet to server. The purpose of this
step is to see if the server is open for new connection.

 The server needs to keep all ports open to establish a new connection. When the server receives
the SYN packet from the client, the client replies and returns the conformation SYN/ approval
(ACK) packet.

 The client receives the SYN/ACK packet and replies with ACK packet to establish the
connection.

Traffic Descriptor
Traffic descriptors are qualitative values that represent a data flow.

Average Data Rate


The average data rate is the number of bits sent during a period of time, divided by the numbers of
seconds in that period.

The average data rate is a very useful characteristic of traffic because it indicates the average bandwidth
needed by the traffic.

Peak Data Rate


The peak data rate defines the maximum data rate of the traffic. In Figure 1 it is the maximum y axis
value. The peak data rate is a very important measurement because it indicates the peak bandwidth that
the network needs for traffic to pass through without changing its data flow
Maximum Burst Size
The peak data rate is a critical value for the network, it can usually be ignored For example, if data are
flowing steadily at the rate of 1 Mbps with a sudden peak data rate of 2 Mbps for just 1 ms, the network
probably can handle the situation. However, if the peak data rate lasts 60 ms, there may be a problem for
the network.

Constant Bit Rate


A constant-bit-rate (CBR), or a fixed-rate, traffic model has a data rate that does not change. In this type
of flow, the average data rate and the peak data rate are the same.

Variable Bit Rate


In the variable-bit-rate (VBR) category, the rate of the data flow changes with time. In this type of flow,
the average data rate and the peak data rate are different. The maximum burst size is usually a small
value.

Bursty
In the bursty data category, the data rate changes suddenly in a very short time. It may jump from zero to
high or vice verse.
Leaky Bucket Algorithm:

If a bucket has a small hole at the bottom, the water leaks from the bucket at a constant rate as long as
there is water in the bucket. The rate at which the water leaks does not depend on the rate at which the
water is input to the bucket unless the bucket is empty. The input rate can vary, but the output rate
remains constant. Similarly, in networking, a technique called leaky bucket can smooth out bursty traffic.

Token Bucket Algorithm

The leaky bucket is very restrictive. It does not credit an idle host. For example, if a host is not
sending for a while, its bucket becomes empty. Now if the host has bursty data, the leaky bucket
allows only an average rate. On the other hand, the token bucket algorithm allows idle hosts to
accumulate credit for the future in the form of tokens. For each tick of the clock, the system sends n
tokens to the bucket. The system removes one token for every cell (or byte) of data sent. For
example, if n is 100 and the host is idle for 100 ticks, the bucket collects 10,000 tokens. Now the host
can consume all these tokens in one tick with 10,000 cells, or the host takes 1000 ticks with 10 cells
per tick. In other words, the host can send bursty data as long as the bucket is not empty. The token
bucket can easily be implemented with a counter. The token is initialized to zero. Each time a token
is added, the counter is incremented by 1. Each time a unit of data is sent, the counter is decremented
by 1. When the counter is zero, the host cannot send data.
QUALITY OF SERVICE (QoS)

Quality of service (QoS) is the overall performance of a telephony or computer network, particularly the
performance seen by the users of the network.

Reliability
Reliability is a characteristic that a flow needs. Lack of reliability means losing a packet or
acknowledgment. For example, it is more important that electronic mail, file transfer, and Internet
access have reliable transmissions than telephony or audio conferencing.

Delay
Source-to-destination delay is another flow characteristic. Again applications can tolerate delay in
different degrees. In this case, telephony, audio conferencing, video conferencing, and remote log-in
need minimum delay, while delay in file transfer or e-mail is less important.

Jitter
Jitter is the variation in delay for packets belonging to the same flow. For example, if four
packets depart at times 0, 1, 2, 3 and arrive at 20, 21, 22, 23, all have the same delay, 20 units
of time. On the other hand, if the above four packets arrive at 21, 23, 21, and 28, they will
have different delays: 21,22, 19, and 24.

Bandwidth
Different applications need different bandwidths. In video conferencing we need to send
millions of bits per second to refresh a color screen while the total number of bits in an e-mail
may not reach even a million.

Sample Questions (Module-3)

1. One of the IP Address of a network is192.168.5.85. The Subnet Mask is255.255.255.0. Design 4
subnets of equal sizes. (CO4, BL-4).
2. Show the address space of Class B is2^30 using dotted decimal format of representation. (CO4, BL-
4).
3. In which situation UDP is used instead of TCP? (CO3, BL-5).
4. Mac address changes from hop to hop but Port address remains constant. Justify the
statement and the scenario. (CO3, BL-4).
Module-4: Application Layer
The application layer is built on the transport layer and provides network services to user applications.
The application layer defines and performs such applications as electronic mail (e-mail), remote access to
computers, file transfers, the Web, as well as real-time video conferencing.

The application layer has its own software dependencies. When a new application is developed, its
software must be able to run on In client/server architecture for example, a client end host requests
services from a server host.

Client and Server Model

A client/server model provides specific computational services. Reliable communication protocols, such
as TCP, allow interactive use of remote servers. For example, we can build a server that provides remote
query processing services to clients. Implementing such a communication service requires a server loaded
with the application protocol to accept requests and a client to make such requests. To invoke remote
query processing, a user first executes a client program establishing a TCP connection to a server. Then,
the client begins transmitting the query to the server. The server processes the received instruction and
sends the results back.

Fig-Application-layer communication
1. Domain Name Space

One of the most important components of the application layer is the Domain Name System (DNS)
server. DNS is a distributed hierarchical and global directory that translates machine or domain names to
numerical IP addresses.

Any entity in the TCP/IP environment is identified by an IP address, which thereby identifies the
connection of the corresponding host to the Internet. An IP address can also be assigned a domain name.
Unique domain names assigned to hosts must be selected from a name space and are generally organized
in a hierarchical fashion.

Domain names are defined in a tree-based structure with the root at the top. A tree is structured with a
maximum of 128 levels, starting at level 0 (root). Each level consists of nodes. A node on a tree is
identified by a label, with a string of up to 63 characters, except for the root label, which has empty string.
A domain name is a sequence of labels separated by dots and is read from the node up to the root. For
example, moving from right to left, we can parse as follows: domain name news.company1.com, a
commercial organization (.com) and the “news” section of "company1" (news.company1).

2. Domain-Name Servers

The domain name space is divided into sub domains, and each domain or sub domain is assigned a
domain name server. A domain name server has a database consisting of all the
information for every node under that domain.
 Requirement
Every host is identified by the IP address but remembering numbers is very difficult for the
people and also the IP addresses are not static therefore a mapping is required to change the
domain name to IP address. So DNS is used to convert the domain name of the websites to
their numerical IP address.

 Domain:
There are various kinds of DOMAIN :

 Generic domain:
 .com (commercial) .edu (educational) .mil (military)
 .org (non-profit organization) .net (similar to commercial) all these are generic domain.

 Country domain .in (India) .us (USA) .uk (UK)

3. Electronic mail (E-Mail)

The earliest and the most common application of the Internet is electronic mail or email. Email is
a store-and-forward application. This means a message can be sent to someone not currently
connected to the Internet. The message can remain in the system until the recipient retrieves it.

Email supports:
 Sending a single message to one or more recipients.
 Sending messages that include text, voice, video, or graphics.
 Organization of message-based criteria such as priority.
Components of E-Mail

The sending of electronic mail in the Internet requires these components: user agents (UAs), mail
transfer agents (MTAs), and the protocol that controls mail delivery— Simple Mail Transfer
Protocol (SMTP).

User Agent (UA): The user agent is software installed on the user computer that reads, replies,
forwards, saves, and composes messages. For example Microsoft’s Outlook provides the users
with a menu or window environment and allow the sending of text and multimedia.

Mail Transfer Agent (MTA): The actual mail transfer requires a mail transfer agent (MTA).
The client MTA is installed on the user’s computer. The client and the server MTA are installed
on a computer that is used as the mail server.

Simple Mail Transfer Protocol: Simple mail transfer protocol (SMTP) is the protocol that defines the
relationship between the UAs and MTAs, defines the format of the message to be transferred.

Stages of SMTP mail delivery

Step-1: In the first stage, the email goes from the user agent to the local server. The mail is stored here
until the remote server is available.

Step-2: In the second stage, the email is relayed by the local server. SMTP messages must be received by
a server that is always running since mail can arrive at any time. However, people often turn off their
computers at the end of the day, and those with laptops or mobile computers do not normally have them
on all the time. So usually an organization (or an ISP) assigns a computer to be the email server and runs
the SMTP server program.

Step-3: In the third stage, the remote user agent uses a mail access protocol such as POP3 or IMAP4 to
access the mailbox and retrieve the mail.
4. File Transfer and FTP
File transfer is another computer networking application. It is always essential that files and information
geographically distributed over different locations be shared among the members of a working group. In a
certain application, files are typically saved in a server. A user then uses a file transfer protocol to access
the server and transfer the desired file.

5. TELNET:

TELNET is an abbreviation for terminal network. TELNET is a general-purpose client-server program


that lets a user access any application program on a remote computer; in other words, it allows the user to
log onto a remote computer. After logging on, a user can use the services available on the remote
computer and transfer the results back to the local computer.

6. WORLD WIDE WEB (HTTP)

The World Wide Web has been so successful and has made the Internet accessible. Any web browser has
a function that allows the users to open a URL. URLs (Uniform Resource Locators) provide
information about the location of objects on the Web; they look like the following:
http://www.cs.princeton.edu/index.html
If you opened that particular URL, your Web browser would open a TCP connection to the Web server at a
machine called www.cs.princeton.edu and immediately retrieve and display the file called index.html.
Most files on the Web contain images and text, and some have audio and video clips. These embedded
URLs are called hypertext links.
The Hyper Text Transfer Protocol (HTTP) is the foundation of World Wide Web. Hypertext is well
organized documentation system which uses hyperlinks to link the pages in the text documents. HTTP
works on client server model. When a user wants to access any HTTP page on the internet, the client
machine at user end initiates a TCP connection to server. When the server accepts the client request, the
client is authorized to access web pages.
Questions(Module-4)

1. Compare HTTP and SMTP (CO1, BL4)


2. Explain FTP with an example (CO1, BL4)
3. Explain with example domain name space (CO2, BL5)
4. What is SMTP? Explain with suitable example. (CO2, BL4)
Module-5(Network Security)
1. Cryptography

Cryptography is associated with the process of converting ordinary plain text into unintelligible text
and vice-versa. It is a method of storing and transmitting data in a particular form so that only those
for whom it is intended can read and process it.

Data Confidentiality, Data Integrity, Authentication and Non-repudiation are core


principles of modern-day cryptography.

1. Confidentiality refers to certain rules and guidelines usually executed under


confidentiality agreements which ensure that the information is restricted to certain
people or places.
2. Data integrity refers to maintaining and making sure that the data stays accurate
and consistent over its entire life cycle.
3. Authentication is the process of making sure that the piece of data being claimed
by the user belongs to it.
4. Non-repudiation refers to ability to make sure that a person or a party associated
with a contract or a communication cannot deny the authenticity of their signature
over their document or the sending of a message.

 Public Key Cryptography

The most important properties of public key encryption scheme are −


 Different keys are used for encryption and decryption. This is a property which set
this scheme different than symmetric encryption scheme.
 Each receiver possesses a unique decryption key, generally referred to as his
private key.
 Receiver needs to publish an encryption key, referred to as his public key.
 Some assurance of the authenticity of a public key is needed in this scheme to
avoid spoofing by adversary as the receiver. Generally, this type of cryptosystem
involves trusted third party which certifies that a particular public key belongs to
a specific person or entity only.
 Encryption algorithm is complex enough to prohibit attacker from deducing the
plaintext from the ciphertext and the encryption (public) key.
 Though private and public keys are related mathematically, it is not be feasible to
calculate the private key from the public key. In fact, intelligent part of any
public-key cryptosystem is in designing a relationship between two keys.

ff
sd
fd
RSA Cryptosystem

This cryptosystem is one the initial system. It remains most employed cryptosystem
even today. The system was invented by three scholars Ron Rivest, Adi
Shamir, and Len Adleman and hence, it is termed as RSA cryptosystem.
We will see two aspects of the RSA cryptosystem, firstly generation of key pair and
secondly encryption-decryption algorithms.

Generation of RSA Key Pair


Each person or a party who desires to participate in communication using encryption
needs to generate a pair of keys, namely public key and private key. The process
followed in the generation of keys is described below −
 Generate the RSA modulus (n)
o Select two large primes, p and q.
o Calculate n=p*q. For strong unbreakable encryption, let n be a large
number, typically a minimum of 512 bits.
 Find Derived Number (e)
o Number e must be greater than 1 and less than (p − 1)(q − 1).
o There must be no common factor for e and (p − 1)(q − 1) except for 1. In
other words two numbers e and (p – 1)(q – 1) are coprime.
 Form the public key
o The pair of numbers (n, e) form the RSA public key and is made public.
o Interestingly, though n is part of the public key, difficulty in factorizing a
large prime number ensures that attacker cannot find in finite time the two
primes (p & q) used to obtain n. This is strength of RSA.
 Generate the private key
o Private Key d is calculated from p, q, and e. For given n and e, there is
unique number d.
o Number d is the inverse of e modulo (p - 1)(q – 1). This means that d is the
number less than (p - 1)(q - 1) such that when multiplied by e, it is equal to
1 modulo (p - 1)(q - 1).
o This relationship is written mathematically as follows −
ed = 1 mod (p − 1)(q − 1)
Example
An example of generating RSA Key pair is given below. (For ease of understanding,
theprimes p & q taken here are small values. Practically, these values are very high).
 Let two primes be p = 7 and q = 13. Thus, modulus n = pq = 7 x 13 = 91.
 Select e = 5, which is a valid choice since there is no number that is
commonfactor of 5 and (p − 1)(q − 1) = 6 × 12 = 72, except for 1.
 The pair of numbers (n, e) = (91, 5) forms the public key and can be
madeavailable to anyone whom we wish to be able to send us encrypted
messages.
 Input p = 7, q = 13, and e = 5 to the Extended Euclidean Algorithm. The
outputwill be d = 29.
 Check that the d calculated is correct by computing −
de = 29 × 5 = 145 = 1 mod 72
 Hence, public key is (91, 5) and private keys is (91, 29).

Sample Questions(Module-5)
1. What are the various security goals? (CO3, BL-4).
2. “Network security is not cryptography “Justify your answer (CO4, BL-4).
3. Evaluate RSA algorithm with an example (CO4, BL5).
4. Create a private key and public key with an example. (CO4, BL-6).

Page | 22

You might also like