Computer Networking and Network Security
Computer Networking and Network Security
COURSE MATERIAL
COMPUTER NETWORKS AND SYSTEM SEECURITY
OBJECTIVES:
The student should be made to:
• Understand the division of network functionalities into layers.
• Be familiar with the components required to build different types of
networks
• Be exposed to the required functionality at each layer
• Learn the flow control and congestion control algorithms
SYLLABUS
UNIT-I INTRODUCTION
Overview of Computer Networks —Applications — Line Configuration
—Topology — Transmission Modes— Categories of Network: LAN,MAN,
WAN - Reference Models - and TCP/IP Models—Physical Layer—
Theoretical Basis for Data Communication— Guided Transmission Media.
OUTCOMES:
At the end of the course, the student should be able to:
Identify the components required to build different types of networks
Choose the required functionality at each layer for given application
Identify solution for each functionality at each layer
Trace the flow of information from one node to another node in the
network
TEXT BOOK:
1. Behrouz A. Forouzan, ―Data communication and Networking‖, Fifth
Edition, Tata McGraw –Hill, 2013 (UNIT I –V)
REFERENCES
1. James F. Kurose, Keith W. Ross, ―Computer Networking - A Top-
Down Approach Featuring the Internet‖, Seventh Edition, Pearson
Education, 2016.
2. Nader. F. Mir,― Computer and Communication Networks‖,
Pearson Prentice Hall Publishers, 2nd Edition, 2014.
3. Ying-Dar Lin, Ren-Hung Hwang, Fred Baker, ―Computer
Networks: An Open Source Approach‖, Mc Graw Hill Publisher,
2011.
4. Larry L. Peterson, Bruce S. Davie, ―Computer Networks: A
Systems Approach‖, Fifth Edition, Morgan Kaufmann Publishers,
2011.
CONTENTS
S.
Contents
No.
1.
UNIT-I INTRODUCTION
Overview of Computer Networks —
— IP Address
— Connection Management
—Addressing
4.
UNIT -IV NETWORK SECURITY
— Network Security Overview
AuthenticationAppIications
Web Security
— Firewall.
UNIT -1
INTRODUCTION
1.1 Overview of Computer Networks
1.1.1 Introduction of Computer Networks
Today the world scenario is changing. Data Communication and
network have changed the way business and other daily affair works. Now,
they rely on computer networks and internetwork. A set of devices often
mentioned as nodes connected by media link is called a Network. A node
can be a device which is capable of sending or receiving data generated by
other nodes on the network like a computer, printer etc. These links
connecting the devices are called Communication channels.
Computer network is a telecommunication channel through which we
can share our data. It is also called data network. The best example of
computer network is Internet. Computer network does not mean a system
with control unit and other systems as its slave. It is called a distributed
system
A network must be able to meet certain criteria, these are mentioned below:
1. Performance
2. Reliability
3. Scalability
Performance
It can be measured in following ways :
• Transit time : It is the time taken to travel a message from one device to
another. Response time : It is defined as the time elapsed between enquiry
and response.
Other ways to measure performance are .
1. Efficiency of software
2. Number of users
3. Capability of connected hardware
Reliability
It decides the frequency at which network failure take place. More the
failures are, less is the network's reliability,
Security
It refers to the protection of data from the unauthorised user or
access. While travelling through network, data passes many layers of
network, and data can be traced if attempted. Hence security is also a very
important characteristic for Networks.
1.1.2 Properties of Good Network
l. Interpersonal Communication : We can communicate with each other
efficiently and easily example emails, chat rooms, video conferencing
etc.
2. Resources can be shared : We can use the resources provided by network
such as printers etc.
3. Sharing files, data : Authorised users are allowed to share the files on
the network.
1.1.3 Basic Communication Model
Communication model is used to exchange data between two parties.
For example communication between a computer, server and telephone
(through modem).
Receiver accepts the signal from the transmission system and converts
it to a form which is easily managed by the destination device.
Destination
Destination receives the incoming data from the receiver.
1.1.4.1 Local :
Local communication takes place when the communicating devices are in
the same geographical area, same building, face-to-face between individuals
etc.
1.1.4.2 Remote :
Remote communication takes place over a distance i.e. the devices are
farther. Effectiveness of a Data Communication can be measured through the
following features:
1.2 Applications
The computer networks are playing an important role in providing
services to large organizations as well as to the individual common man.
1.2.1 Service Provided by the Network for Companies:
1. Resource sharing.
3. To save money.
4. It can provide a powerful communication medium.
1. Resource sharing
Show in Fig (a) and (b) which shows a printer being shared and
different information
Request
Client/server communication
• The client places a request on the server machine when he wants an
access to the centralized resources.
• The server responds to this request and sends the signal accordingly
to the client.
• The software run at the client computer is called as client program.
This software configures the computer to act as a client.
(iii) Worldwide newsgroups in which one person posts a message and all
other subscribers to the newsgroup can read it or give their feedbacks.
3. Interactive entertainment:
Interactive entertainment includes:
(i) Multiperson real-time simulation games.
(ii) Video on demand.
(iii) Participation in live TV programmes likes quiz, contest, discussions etc.
In short, the ability to merge information, communication and entertainment
will surely give rise to a massive new industry based on computer
networking.
L. Point-to-Point connection
2. Multipoint connection
Workstation Workstation
Workstation Workstation
1.4 Topology
Network Topology is the schematic description of a network
arrangement, connecting various nodes(sender and receiver) through lines
of connection.
1.4.1 Types of Network Topology
• BUS Topology
• RING Topology
• STAR Topology • MESH Topology
• TREE Topology
• HYBRID Topology
1.4.2 BUS Topologv
Bus topology is a network type in which every computer and
network device is connected to single cable. When it has exactly two
endpoints, then it is called Linear Bus topology.
1. It is cost effective.
2. Cable required is least compared to other network topology.
3. Used in small networks.
4. It is easy to understand.
5, Easy to expand joining two cables together.
l. A number of repeaters are used for Ring topology with large number
of nodes, because if someone wants to send some data to the last node
in the ring topology with 100 nodes, then the data will have to pass
through 99 nodes to reach the 100th node. Hence to prevent data loss
repeaters are used in the network.
2. The transmission is unidirectional, but it can be made bidirectional by
having 2 connections between each Network Node, it is called Dual Ring
Topology.
3. In Dual Ring Topology, two ring networks are formed, and data flow is
in opposite direction in them. Also, if one ring fails, the second ring can
act as a backup, to keep the network up.
4. Data is transferred in a sequential manner that is bit by bit. Data
transmitted, has to pass through each node of the network, till the
destination node.
1.4.3.2 Advantages of Ring Topology
l. Transmitting network is not affected by high traffic or by adding more
nodes, as only the nodes having tokens can transmit data.
2. Cheap to install and expand
1. Routing
2. Flooding
1.4.5.1 Routing
In routing, the nodes have a routing logic, as per the network
requirements. Like routing logic to direct the data to reach the destination
using the shortest distance. Or, routing logic which has information about
the broken links, and it avoids those node etc. We can even have routing
logic, to re-configure the failed nodes.
1.4.5.2 Flooding
In flooding, the same data is transmitted to all the network nodes, hence
no routing logic is required. The network is robust, and the its very
unlikely to lose the data. But it leads to unwanted load over the network.
1. Fully connected.
2. Robust.
3. Not flexible.
1. Heavily cabled.
2. Costly.
3. If more nodes are added maintenance is difficult.
4. Central hub fails, network fails.
1. Complex in design.
2. costly.
1.5 Transmission Modes
Transmission mode means transferring of data between two devices.
It is also called communication mode. These modes direct the direction
of flow of informatión. There are three types of transmission mode. They
are .
Simplex Mode
Half duplex Mode
Full duplex Mode
Tiansnúsáon Mode
In full duplex system there can be two lines one for sending the data and the
other for receiving data.
1.6 Categories of Network: LAN. MAN, WAN
Bus Network
C Different T0Þ0bgøs nterconnected a Local Area Network )
R
outer Bus Network
Connected
SESSION LAYER
TRANSPORTLAYER,
"ETWORK
NETWORK LAYER
DATA NK LAVER
DATA K LAÑER€U
-PÈIYSQAL LAYER
The overall idea was to allow one application on one computer to talk
to(send data packets) another application running on different computer.
TRANSPORT LAYER
INTERNETLAYER
HOST-TO-NETWORK
(NETWORKACCESS
LAYER)
1. It operated independently.
2. It is scalable.
3. Client/server architecture.
4. Supports a number of routing protocols.
5. Can be used to establish a connection between two computers.
2. In OSI model the transport layer 2. In TCP/IP model the transport layer does
guarantees the delivery of packets. not guarantees delivery of packets. Still the
TCP/IP
model is more reliable.
4. OSI model has a separate 4. TCP/IP does not have a separate Presentation
Presentation layer and Session layer. layer or Session layer.
7. OSI model has a problem of fitting 7. TCP/IP model does not fit any protocol
the protocols into the model.
1.8.2 Signals
When data is sent over physical medium, it needs to be first
converted into electromagnetic signals. Data itself can be analog
such as human voice, or digital such as file on the disk. Both analog
and digital data can be represented in digital or analog signals.
Digital Signals
Digital signals are discrete in nature and represent sequence of voltage
pulses. Digital signals are used within the circuitry of a computer
system.
Analog Signals
Analog signals are in continuous wave form in nature and represented
by continuous electromagnetic waves.
Thermal Noise
Heat agitates the electronic conductors of a medium which may
introduce noise in the media. Up to a certain level, thermal noise is
unavoidable.
Intermodulation
When multiple frequencies share a medium, their interference
can cause noise in the medium. Intermodulation noise occurs if
two different frequencies are sharing a medium and one of them
has excessive strength or the component itself is not functioning
properly, then the resultant frequency may not be delivered as
expected.
Crosstalk
This sort of noise happens when a foreign signal enters into the
media. This is because signal in one medium affects the signal of second
medium.
Impulse
This noise is introduced because of irregular disturbances
such as lightening, electricity, short-circuit, or faulty components.
Digital data is mostly affected by this sort of noise.
1.8.4 Channel Capacity
The speed of transmission of information is said to be the channel
capacity. We count it as data rate in digital world. It depends on
numerous factors such as:
• Bandwidth: The physical limitation of underlying media.
c
2+ x an sin(2 nft)+ x
2 an g(t)sin(2 nft)dt
TO
z
2 sin(2 nf t)dt + Z sin(2 nf t)dt]
6
2 1 cos(2
1 [cos(2 nf3) cos(2 nf) + cos(2 nf7) cos(2 nf 6)] nfT
f = 1=8
= n=4)) cos(3 n=4) + cos(6 n=4) cos(7 n=4)]
Similarly, n [sin(3 n=4)) sin( n=4) + sin(7 n=4) sin(6 n=4)]
And
g(t)dt 2 6 3
Note: baud rate is not the same thing as the data rate. For a given
baud rate, we can increase the data rate by changing the encoding
method (subject to Nyquist and Shannon limits, of course.)
What kind of data rate can we achieve using voice-grade phone lines?
The phone system is designed to carry human voices (not data!), and
its bandwidth line is limited to about 3 kHz.
Suppose that we have a bit rate of b bits/sec (assume only encode one bit
of data per baud).
2400 300 10
4800 600 5
9600 1200 2.5
19200 2400 1.25
38400 4800 .625
s
ignal power
s-N(db) -
1010M 0 noise
power
1.9.4 Shannon's Theorem
d
b) 103
=
10—49-
1000.
Thus, the maximum data rate = 3000 log2(1 + 1000) 30; 000 bps.
But wait I don't modems deliver data at 38.4 and 56 kbps? Many
modem companies advertise that their modem deliver higher data
rates, are they lying? Not necessarily. Read the ne print. Most likely,
the modem uses data compression, and the high data rate is achieved
only with text data
Let's summarize what Nyquist and Shannon say:
1.10.2.1 Advantages :
• Installation is easy
• Flexible
• Cheap
• It has high speed capacity,
• 100 meter limit
• Higher grades of UTP are used in LAN technologies like Ethernet.
It consists of two insulating copper wires (Imm thick). The wires are
twisted together in a helical form to reduce electrical interference
from similar pair.
1.10.2.2 Disadvantages :
• Bandwidth is low when compared with Coaxial Cable
• Provides less protection from interference.
1.103 Shielded Twisted Pair Cable
This cable has a metal foil or braided-mesh covering which
encases each pair of insulated conductors. Electromagnetic noise
penetration is prevented by metal casing. Shielding also eliminates
crosstalk (explained in KEY TERMS Chapter).
It has same attenuation as unshielded twisted pair. It is faster the
unshielded and coaxial cable. It is more expensive than coaxial and
unshielded twisted pair.
1.10.3.1 Advantages :
• Easy to install
• Performance is adequate
• Can be used for Analog or Digital transmission
• Increases the signalling rate
• Higher capacity than unshielded twisted pair Eliminates crosstalk
1.10.3.2 Disadvantages :
• Difficult to manufacture
• Heavy
1.10.4Coaxia1 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. It is
surrounded by PVC installation, a sheath which is encased in an
outer conductor of metal foil, barid or both.
Outer metallic wrapping is used as a-shield against noise and as the
second conductor which completes the circuit. The outer conductor
is also encased in an insulating sheath. The outermost part is the
plastic cover which protects the whole cable.
Here the most common coaxial standards.
1.10.4.4 Disadvantages :
• Single cable failure can fail the entire network.
• Difficult to install and expensive when compared with twisted pair.
• If the shield is imperfect, it can lead to grounded loop.
1.10.5Fiber optic Cable
These are-similar to coaxial •cable. It uses electric signals to
transmit data. At the centre is the glass core through which light
propagates.
In multimode fibres, the core is 50microns, and In single mode fibres,
the thickness is 8 to 10 microns.
The core in fiber optic cable is surrounded by glass cladding
with lower index of refraction as compared to core to keep all the
light in core. This is covered with a thin plastic jacket to protect the
cladding. The fibers are grouped together in bundles protected by an
outer-shield.
Fiber optic cable has bandwidth more than 2 gbps (Gigabytes
per Second)
Glass cladding
Glass Core Jacket
1.10.5.1Advantages :
• Provides high quality transmission of signals at very high speed.
• These are not affected by electromagnetic interference, so noise
and distortion is very less.
• Used for both analog and digital signals.
1.10.5.2 Disadvantages :
• It is expensive
• Difficult to install.
• Maintenance is expensive and difficult.
• Do not allow complete routing of light signal
UNIT -11
DATA LINK LAYER
2.1 Data Link Layer
Data Link Layer is second layer of OSI Layered Model.
This layer is one of the most complicated layers and has complex
functionalities and liabilities. Data link layer hides the details of
underlying hardware and represents itself to upper layer as the
medium to communicate.
Data link layer works between two hosts which are directly
connected in some sense. This direct connection could be point to
point or broadcast. Systems on broadcast network are said to be on
same link. The work of data link layer tends to get more complex
when it is dealing with multiple hosts on single collision domain.
Data link layer is responsible for converting data stream to
signals bit by bit and to send that over the underlying hardware.
At the receiving end, Data link layer picks up data from hardware
which are in the form of electrical signals, assembles them in a
recognizable frame format, and hands over to upper layer.
Sent Received
Sent Received
Sent
Received
Frame contains more than 1 consecutive bits corrupted.
Error control mechanism may involve two possible ways:
o Error detection
o Error correction
2.2.1 Error Detection
Errors in the received frames are detected by means of Parity
Check and Cyclic Redundancy Check (CRC). In both cases, few
extra bits are sent along with actual data to confirm that bits received
at other end are same as they were sent. If the countercheck at
receiver end fails, the bits are considered corrupted.
Parity Check
One extra bit is sent along with the original bits to make number of Is
either even in case of even parity, or odd in case of odd parity.
The sender while creating a frame counts the number of Is in it. For example, if
even parity is used and number of Is is even then one bit with value 0 is added.
This way number of Is remains even. If the number of Is is odd, to makè it even
a bit with value I is added.
Data Bits
Divisor
Sender Receiver
101
000
At the other end, the receiver performs division operation on
codewords using the same CRC divisor. If the remainder contains
all zeros the data bits are accepted, otherwise it is considered as there
is some data corruption occurred in transit.
2r>=m+r+1
2.3 Elementarv Data Link Protocols
Data-link layer is responsible for implementation of point-to-point
flow and error control mechanism.
Flow Control
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.
What if the speed (hardware/software) of the sender or receiver
differs? If sender is sending too fast the receiver may be overloaded,
(swamped) and data may be lost.
Two types of mechanisms can be deployed to control the flow:
Stop and Wait
This flow control mechanism forces the sender after transmitting a data
frame to stop and wait until the acknowledgement of the data-frame
sent is received.
Sender Receiver
Error Control
When data-frame is transmitted, there is a probability that data-
frame may be lost in the transit or it is received corrupted. In both
cases, the receiver does not receive the correct data-frame and sender
does not know anything about any loss.
In such case, both sender and receiver are equipped with some
protocols which helps them to detect transit errors such as loss of
data-frame. Hence, either the sender retransmits the data-frame or
the receiver may request to resend the previous data-frame.
Requirements for error control mechanism:
Stop and wait ARQ mechanism does not utilize the resources
at their best. When the acknowledgement is received, the sender
sits idle and does nothing. In Go-Back-N ARQ method, both sender
and receiver maintain a window.
The sending-window size enables the sender to send multiple
frames without receiving the acknowledgement of the previous
ones. The receiving-window enables the receiver to receive
multiple frames and acknowledge them. The receiver keeps track of
incoming frame' s sequence number.
When the sender sends all the frames in window, it checks up
to what sequence number it has received positive
acknowledgement. If all frames are positively acknowledged, the
sender sends next set of frames. If sender finds that it has received
NACK or has not receive any ACK for a particular frame, it
retransmits all the frames after which it does not receive any
positive ACK.
Selective Repeat ARO
Sender Receiver
Close Timer
Close Timer
Time-out
Send
again
The sender in this case, sends only packet for which NACK is
received.
LLC 802.2
NeWork layers.
They are
With a connection oriented service, the user must pay for the
length (ie the duration) of his connection. Usually this will involve
a fixed start up fee. Now, if the user intends to send a constant stream
of data down the line, this is great - he is given a reliable service for
as long as he wants. However, say the user wished to send only a
packet or two of data - now the cost of setting up the connection
greatly overpowers the cost of sending that one packet, Consider
also the case where the user wishes to send a packet once every 3
minutes. In a connection-oriented service, the line will thus be idle
for the majority of the time, thus wasting bandwidth. So,
connection-oriented services seem to be useful only when the user
wishes to send a constant stream of data.
Node I
Node 3
Node 4
CI-
æcept Signal
Packet Switching:
Node 1
Node 2
Node 3 pack
Node 4
Node 2
Node 3
Node 4
Two packets of the same user pair c All packets of the same virtual circui
I
travel along different routes travel along the same path.
• CPU
• ROM
• Operating System
4er
Internet Architecture
The router uses its routing table to determine the best path to
forward the packet. When the router receives a packet, it examines
its destination IP address and searches for the best match with a
network address in the router's routing table. The routing table also
includes the interface to be used to forward the packet. Once a
match is found, the router encapsulates the IP packet into the data
link frame of the outgoing or exit interface, and the packet is then
forwarded toward its destination.
2.9.2 Static Routes:
Initial Update:
RI
• Sends an update about network 10.1.0.0 out the Seria10/0/0
interface
• Sends an update about network 10.2.0.0 out the FastEthemet0/0
interface
• Receives update from R2 about network 10.3.0.0 with a metric of
1
• Stores network 10.3.0.0 in the routing table with a metric of 1
O
• Sends an update about network 10.4.0.0 out the Serial 0/0/0
interface
After this first round of update exchanges, each router knows about
the connected networks of their directly connected neighbors.
However, did you notice that RI does not yet know about 10.4.0.0
and that R3 does not yet know about 10.1.0.0? Full knowledge and
a converged network will not take place until there is another
exchange of routing information.
Next Update:
RI
4. Each router floods the ISP to all neighbors, who then store all
LSPs received in a database. Neighbors then flood the LSPs
to their neighbors until all routers in the area have received the
LSPs. Each router stores a copy of each LSP received from its
neighbors in a local database.
5. Each router uses the database to construct a complete map of
the topology and computes the best path to each destination
network. Like having a road map, the router now has a
complete map of all destinations in the topology and the routes
to reach them. The SPF algorithm is used to construct the map
of the topology and to determine the best path to each
network.
Disadvantages of Flooding
Layer 2 loops
Desirable
Congested
Packet sent
Concept of Congestion
Discarding Policy
A good discarding policy by the routers may prevent
congestion and at the same time may not harm the integrity of the
transmission. For example, in audio transmission, if the policy is to
discard less sensitive packets when congestion is likely to happen,
the quality of sound is still preserved and congestion is prevented or
alleviated.
Admission Policy
An admission policy, which is a quality-of-service
mechanism, can also prevent congestion in virtual-circuit networks.
Switches in a flow first check the resource requirement of a flow
before admitting it to the network. A router can deny establishing a
virtualcircuit connection ifthere is congestion in the network or
ifthere is a possibility offuture congestion.
2.10.4 Closed-Loop Congestion Control
Closed-loop congestion control mechanisms try to alleviate congestion
after it happens. Several mechanisms have been used by different
protocols. We describe a few of them here.
Backpressure
The technique of backpressure refers to a congestion control
mechanism in which a congested node stops receiving data from the
immediate upstream node or nodes. This may cause the upstream
node or nodes to become congested, and they, in turn, reject data
from their upstream nodes or nodes. And so on. 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 corning.
Destination
Backpressure Method
Node Ill in the figure has more input data than it can handle.
It drops some packets in its input buffer and informs node Il to slow
down. Node Il, in turn, may be congested because it is slowing down
the output flow of data. If node Il is congested, it informs node I to
slow down, which in turn may create congestion.
If so, node I informs the source of data to slow down. This, in
time, alleviates the congestion. Note that the pressure on node Ill is
moved backward to the source to remove the congestion. None of
the virtual-circuit networks we studied in this book use
backpressure. It was, however, implemented in the first virtual-
circuit network, X.25. The technique cannot be implemented in a
datagram network because in this type of network, a node (router)
does not have the slightest knowledge of the upstream router.
Choke Packet
A choke packet is a packet sent by a node to the source to
inform it of congestion. Note the difference between the
backpressure and choke packet methods. In backpressure, the
warning is from one node to its upstream node, although the warning
may eventually reach the source station. In the choke packet method,
the warning is from the router, which has encountered congestion,
to the source station directly. The intermediate nodes through which
the packet has travelled are not warned.
Choke packet
(a) A leaky Bucket with water (b) A leaky Bucket with packeu
• Also, when the bucket is full, any additional water that enters
into the bucket spills over the sides and is lost.
• The same concept can be applied to packets in the network.
Consider that data is coming from the source at variable speeds.
Suppose that a source sends data at 12 Mbps for 4 seconds. Then
there is no data for 3 seconds. The source again transmits data
at a rate of 10 Mbps for 2 seconds. Thus, in a time span of 9
seconds, 68 Mb data has been transmitted.
If a leaky bucket algorithm is used, the data flow will be 8 Mbps
for 9 seconds. Thus constant flow is maintained.
2. Token bucket Algorithm
• The leaky bucket algorithm allows only an average (constant)
rate of data flow. Its major problem is that it cannot deal with bursty
data.
• A leaky bucket algorithm does not consider the idle time of the
host. For example, if the host was idle for 10 seconds and now it is
willing to sent data at a very high speed for another 10 seconds, the
total data transmission will be divided into 20 seconds and average
data rate will be maintained. The host is having no advantage of
sitting idle for 10 seconds.
• To overcome this problem, a token bucket algorithm is used. A
token bucket algorithm allows bursty data transfers.
• A token bucket algorithm is a modification of leaky bucket in
which leaky bucket contains tokens.
• In this algorithm, a token(s) are generated at every clock tick.
For a packet to be transmitted, system must remove token(s) from the
bucket.
• Thus, a token bucket algorithm allows idle hosts to accumulate
credit for the future in form of tokens.
• For example, if a system generates 100 tokens in one clock tick
and the host is idle for 100 ticks. The bucket will contain 10,000
tokens.
Now, if the host wants to send bursty data, it can consume all 10,000 tokens
at once for sending 10,000 cells or bytes.
Thus a host can send bursty data as long as bucket is not empty.
NETWORK LAYER
Network Layer:
The main aim of this layer is to deliver packets from source to destination
across multiple links (networks). If two computers (system) are connected
on the same link then there is no need for a network layer. It routes the signal
through different channels to the other end and acts as a network controller.
It also divides the outgoing messages into packets and to assemble incoming
packets into messages for higher levels.
4 8 16 32 bits
VER HLEN D.S. type of service Total length of 16 bits
Time to
Protocol Header checksum (16 bits)
live
Source IP address
Destination IP address
Option + Padding
Points to remember:
IPX
AppleTalk
IP addressing provides mechanism to differentiate between hosts and
network. Because IP addresses are assigned in hierarchical manner, a host
always resides under a specific network. The host which needs to
communicate outside its subnet, needs to know destination network address,
where the packet/data is to be sent.
Hosts in different subnet need a mechanism to locate each other.
This task can be done by DNS. DNS is a server which provides Layer-
3 address of remote host mapped with its domain name or FQDN. When
a host acquires the Layer-3 Address (IP Address) of the remote host, it
forwards all its packet to its gateway. A gateway is a router equipped
with all the information which leads to route packets to the destination
host.
Routers take help ofrouting tables, which has the following information:
Address of destination network
Method to reach the network
• 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. All packets are
sent as unicast but because they are sent to all, it simulates as if
router is broadcasting.
Destination
The router must know that there are nodes, which wish to receive
multicast packets (or stream) then only it should forward. Multicast
routing works spanning tree protocol to avoid looping.
Multicast routing also uses reverse path Forwarding technique, to
detect and discard duplicates and loops.
3.3.4 Anycast Routing
Anycast packet forwarding is a mechanism where multiple hosts
can have same logical address. When a packet destined to this logical
address is received, it is sent to the host which is nearest in routing
topology.
Anycast routing is done with help of DNS server. Whenever an
Anycast packet is received it is enquired with DNS to where to send it.
DNS provides the IP address which is the nearest IP configured on it.
De<ination
IP 3.3.3.3 4, 4.4, 4
AC a:a:a:a:a:a
c:c:c:c:c:c nc d:d:d:d:d:d
To know the MAC address of remote host on a broadcast domain,
a computer wishing to initiate communication sends out an ARP
broadcast message asking, "Who has this IP address?" Because it is a
broadcast, all hosts on the network segment (broadcast domain) receive
this packet and process it. ARP packet contains the IP address of
destination host, the sending host wishes to talk to. When a host receives
an ARP packet destined to it, it replies back with its own MAC address.
Once the host gets destination MAC address, it can communicate
with remote host using Layer-2 link protocol. This MAC to IP mapping
is saved into ARP cache of both sending and receiving hosts. Next time,
if they require to communicate, they can directly refer to their respective
ARP cache.
Reverse ARP is a mechanism where host knows the MAC address
of remote host but requires to know IP address to communicate.
3.4.2 Internet Control Message Protocol (ICMP)
ICMP is network diagnostic and error reporting protocol. ICMP
belongs to IP protocol suite and uses IP as carrier protocol. After
constructing ICMP packet, it is encapsulated in IP packet. Because IP
itself is a best-effort non-reliable protocol, so is ICMP.
Any feedback about network is sent back to the originating host.
If some error in the network occurs, it is reported by means of ICMP.
ICMP contains dozens of diagnostic and error reporting messages.
ICMP-echo and ICMP-echo-reply are the most commonly used
ICMP messages to check the reachability of end-to-end hosts. When a
host receives an ICMP-echo request, it is bound to send back an ICMP-
echo-reply. If there is any problem in the transit network, the ICMP will
report that problem.
Internet Protocol Version 4 ßPv4)
IPv4 is 32-bit addressing scheme used as TCP/IP host addressing
mechanišm. IP addressing enables every host on the TCP/IP network to
be uniquely identifiable,
IPv4 provides hierarchical addressing scheme which enables it to
divide the network into sub-networks, each with well-defined number
of hosts. IP addresses are divided into many categories:
Class A: It uses first octet for network addresses and last
three octets for host addressing. Class B: It uses first two
octets for network addresses and last two for host addressing.
Class C: It uses first three octets for network addresses and
last one for host addressing.
•3 Class D: It provides flat IP addressing scheme in contrast to
hierarchical structure for above three.
Class E: It is used as experimental.
Tunneling
• NAT-PT
3.3 Transoort Laver
Next Layer in OSI Model is recognized as Transport Layer
(Layer-4). All modules and procedures pertaining to transportation of
data or data stream are categorized into this layer. As all other layers,
this layer communicates with its peer Transport layer of the remote host.
Transport layer offers peer-to-peer and end-to-end connection
between two processes on remote hosts. Transport layer takes data from
upper layer (i.e. Application layer) and then breaks it into smaller size
segments, numbers each byte, and hands over to lower layer (Network
Layer) for delivery.
Functions
This Layer is the first one which breaks the information data,
supplied by Application layer in to smaller units called segments.
It numbers every byte in the segment and maintains their
accounting.
• This layer ensures that data must be received in the same sequence in
which it was
sent.
•3 This layer provides end-to-end delivery of data between hosts
which may or may not belong to the same subnet.
All server processes intend to communicate over the network are
equipped with well-known Transport Service Access Points
(TSAPs) also known as port numbers.
Initiator Responder
3.6.3 Establishment
Client initiates the connection and sends the segment with a
Sequence number. Server acknowledges it back with its own Sequence
number and ACK of client's segment which is one more than client's
Sequence number. Client after receiving ACK of its segment sends an
acknowledgement of Server's response.
3.6.4 Release
Either of server and client can send TCP segment with FIN flag
set to 1. When the receiving end responds it back by ACKnowledging
FIN, that direction of TCP communication is closed and connection is
released.
3.6.5 Bandwidth Management
TCP uses the concept of window size to accommodate the need
of Bandwidth management. Window size tells the sender at the remote
end the number of data byte segments the receiver at this end can
receive. TCP uses slow start phase by using window size 1 and increases
the window size exponentially after each successful communication.
For example, the client uses windows size 2 and sends 2 bytes of
data. When the acknowledgement of this segment received the
windows size is doubled to 4 and next the segment sent will be 4 data
bytes long. When the acknowledgement of 4-byte data segment is
received, the client sets windows size to 8 and so on.
If an acknowledgement is missed, i.e. data lost in transit network or
it received NACK, then the window size is reduced to half and slow start
phase starts again.
3.6.6 Error Control and Flow Control
TCP uses port numbers to know what application process it
needs to handover the data segment. Along with that, it uses sequence
numbers to synchronize itself with the remote host. All data segments
are sent and received with sequence numbers. The Sender knows which
last data segment was received by the Receiver when it gets ACK. The
Receiver knows about the last segment sent by the Sender by referring
to the sequence number of recently received packet.
If the sequence number of a segment recently received does not
match with the sequence number the receiver was expecting, then it is
discarded and NACK is sent back. If two segments arrive with the same
sequence number, the TCP timestamp value is compared to make a
decision.
3.6.7 Multiplexing
The technique to combine two or more data streams in one session is
called
Multiplexing. When a TCP client initializes a connection with Server, it
always refers to a well-defined port number which indicates the
application process. The client itselfuses a randomly generated port
number from private port number pools.
Using TCP Multiplexing, a client can communicate with a
number of different application process in a single session. For
example, a client requests a web page which in turn contains different
types of data (HTTP, SMTP, FTP etc.) the TCP session timeout is
increased and the session is kept open for longer time so that the three-
way handshake overhead can be avoided.
This enables the client system to receive multiple connection over
single virtual connection. These virtual connections are not good for
Servers if the timeout is too long.
3.6.8 Congestion Control
When large amount of data is fed to system which is not capable of
handling it, congestion occurs. TCP controls congestion by means of
Window mechanism. TCP sets a window size telling the other end how
much data segment to send. TCP may use three algorithms for
congestion control:
Retransmission timer:
Persist timer:
Timed-Wait:
• TCP offers:
• Reliability.
• Efficient Flow Control o Full-duplex operation.
Multiplexing.
TCP Services
TCP offers following services to the processes at the application layer:
Destination
Source Port Port
Points
Trivial File Transfer Protocol is also used to transfer the files but
it transfers the files without authentication. Unlike FTP, TFTP does not
separate control and data information. Since there is no
authentication exists, TFTP lacks in security features therefore it is not
recommended to use TFTP.
Key points
• TFTP makes use of UDP for data transport. Each TFTP message is
carried in separate UDP datagram.
• The request is sent from an ephemeral UDP port to the UDP port
690f an TFTP server.
2 Authentication Yes No
3.16 HyperTextTransferProtoc01(ff1TP)
• Request line
• Header Fields
• Message body
Key Points
The first line i.e. the Request line specifies the request method
i.e.Get or Post.
The second line specifies the header which indicates the domain
name of the server from where index.htm is retrieved.
HTTP Response
Like HTTP request, HTTP response also has certain structure. HTTP
response contains:
Status line
Headers
Message body
UNIT-IV
NETWORK SECURITY
4.1 Network Security Overview
In this modern era, organizations greatly rely on computer
networks to share information throughout the organization in an
efficient and productive manner. Organizational computer networks
are now becoming large and ubiquitous. Assuming that each staff
member has a dedicated workstation, a large scale company would
have few thousands workstations and many server on the network.
4.1.1
A network is defined as two or more computing devices
connected together for sharing resources efficiently. Further,
connecting two or more networks together is known as
internetworking. Thus, the Internet is just an internetwork — a
collection of interconnected networks.
TCP/IP Protocol
Transmission Control Protocol (TCP) and Internet Protocol (IP)
are two distinct computer network protocols mostly used together.
Due to their popularity and wide adoption, they are built in all
operating systems of networked devices.
Other protocols such as ARP, DHCP, SMTP, etc. also have their
vulnerabilities that can be exploited by the attacker to compromise the
network security. We will discuss some of these vulnerabilities in later
chapters.
The least concern for the security aspect during design and
implementation of protocols has turned into a main cause of threats to
the network security.
Plaintext 110010001010
Funcøon
200110101101
Block of ciphertext
A block cipher takes a block of plaintext bits and generates a
block of ciphertext bits, generally of same size. The size of block is
fixed in the given scheme. The choice of block size does not directly
affect to the strength of encryption scheme. The strength of cipher
depends up on the key length.
• Do not have very large block size — With very large block size,
the cipher becomes inefficient to operate. Such plaintexts will
need to be padded before being encrypted.
• Serpent — A block cipher with a block size of 128 bits and key
lengths of 128, 192, or 256 bits, which was also an AES
competition finalist. It is a slower but has more secure design
than other block cipher.
42.2 Stream Ciphers
In this scheme, the plaintext is processed one bit at a time i.e. one
bit of plaintext is taken, and a series of operations is performed on it
to generate one bit of ciphertext. Technically, stream ciphers are block
ciphers with a block size of one bit.
Since DES is based on the Feistel Cipher, all that is required to specify
DES is —
• Round function
• Key schedule
• Any additional processing — Initial and final permutation
43.1 Inw and Final
The initial and final permutations are straight Permutation boxes
(P-boxes) that are inverses of each other.
RoundFgncûon
The heart of this cipher is the DES function, f The DES function
applies a 48-bit key to the rightmost 32 bits to produce a 32-bit output.
K, (48 bits)
Out
• Expansion Permutation Box — Since right input is 32-bit and
round key is a 48bit, we first need to expand right input to 48 bits.
Permutation logic is graphically depicted in the following
illustration
From bit 32 From bit I
32-bit output
01 15 23 26 05 18 31 10
02 08 24 14 32 27 03 09
19 13 30 06 22 Il 04 25
43.4 Kep
The round-key generator creates sixteen 48-bit keys out of a 56-bit cipher
key. The process of key generation is depicted in the following illustration
—
key vsith
panty bits
Shining
The logic for Parity drop, shifting, and Compression P-box is given in
the DES description.
The DES satisfies both the desired properties of block cipher. These two
properties make cipher very strong.
DES has proved to be a very well designed block cipher. There have
been no significant cryptanalytic attacks on DES other than exhaustive
key search.
4.4Public key Encryption and Hash Functions
Encryption is a security method in which information is encoded
in such a way that only authorized user can read it. It uses encryption
algorithm to generate cipher-text that can only be read if decrypted.
Types of Encryption
There are two types of encryptions schemes as listed below:
Key Points
For example, the message is " the combination to the safe is two,
seven, thirty-five". The hash of this message, using our simple hashing
algorithm is as follows:
2 x 6 x 3 ) + 4 = 40
The hash of this message is sent to John with cipher text. After
he decrypts the message, he computes its hash value using the agreed
upon hashing algorithm. If the hash value sent by Bob doesn't match
the hash value of decrypted message, John will know that the message
has been altered.
Hash Value h
(fixed length)
Features ofHash Functions
The typical features of
hash functions are — •
Fixed Length Output
(Hash Value)
o Hash function coverts data of arbitrary length to a fixed
length. This process is often referred to as hashing the data.
o In general, the hash is much smaller than the input data, hence
hash functions are sometimes called compression functions.
• Pre-Image Resistance
• This property means that it should be computationally hard
to reverse a hash function.
• In other words, if a hash function h produced a hash value
z, then it should be a difficult process to find any input
value x that hashes to z.
• Collision Resistance
0 This property means it should be hard to find two different
inputs of any length that result in the same hash. This
property is also referred to as collision free hash function.
In other words, for a hash function h, it is hard to find any two
different inputs x and y such that h(x) = h(y).
This process is repeated for as many rounds as are required to hash the
entire message.
Schematic of hashing algorithm is depicted in the following illustration
—
Since, the hash value of first message block becomes an input to the
second hash operation, output of which alters the result of the third
operation, and so on. This effect, known as an avalanche effect of
hashing.
MD5 was most popular and widely used hash function for quite
some years.
• In October 2012, the MST chose the Keccak algorithm as the new
SHA-3 standard. Keccak offers many benefits, such as efficient
performance and good resistance for attacks.
3.RIPEMD
The RIPEND is an acronym for RACE Integrity Primitives Evaluation
Message Digest. This set of hash functions was designed by open
research community and generally known as a family of European
hash functions.
1. Whirlpool
This is a 512-bit hash function.
l. Password Storage
Hash functions provide protection to password storage.
45.2RSA
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.
Form the public key o The pair of numbers (n, e) form the RSA
public key and is made public.
Example
An example of generating RSA Key pair is given below. (For ease of
understanding, the primes p & q taken here are small values. Practically,
these values are very high).
• The pair of numbers (n, e) = (91, 5) forms the public key and can be
made available 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 output will be d = 29.
RSA Encryption
• Suppose the sender wish to send some text message to someone
whose public key is (n, e).
RSA Decryption
• The decryption process for RSA is also very straightforward.
Suppose that the receiver of public-key pair (n, e) has received a
ciphertext C.
• Receiver raises C to the power of his private key d. The result modulo
n will be the plaintext P.
Plaintext = Cd mod n
Passive Attacks:
Passive attacks are in the nature of eavesdropping on, or monitoring
of, transmissions. The goal of the opponent is to obtain information
that is being transmitted. Two types of passive attacks are release of
message contents and traffic analysis.
Alice
(b)TfiMTtcanalysis
Replay involves the passive capture of a data unit and its subsequent
retransmission to produce an unauthorized effect (Figure I .41)).
Modification of messages simply means that some portion of a
legitimate message is altered, or that messages are delayed or
reordered, to produce an unauthorized effect (Figure 1.4c). For
example, a message meaning "Allow John Smith to read confidential
file accounts" is modified to mean "Allow Fred Brown to read
confidential file accounts.
(d) of service
Modification of Denial of
contents analysis message contents service
Figure 1.2 Active and Passive Security Threats
51.3 Twa ofNetwork Seczuitv Devices
Active Devices
These security devices block the surplus traffic. Firewalls, antivirus
scanning devices, and content filtering devices are the examples of such
devices.
Passive Devices
These devices identify and report on unwanted traffic, for example,
intrusion detection appliances.
Preventative Devices
These devices scan the networks and identify potential security problems.
For example, penetration testing devices and vulnerability assessment
appliances.
Data integrity: The assurance that data received are exactly as sent by
an authorized entity (i.e., contain no modification, insertion, deletion,
or replay).
information)
The general model shows that there are four basic tasks in designing a
particular security service:
Opponent
h•ckerÞ
(e.g., worm)
The IETF is responsible for publishing the RFCs, with approval of the
IESG. The RFCs are the working notes of the Internet research and
development community.
A document in this series may be on essentially any topic related
to computer communications and may be anything from a meeting
report to the specification of a standard. The work of the IETF is
divided into eight areas, each with an area director and each composed
of numerous working groups.
The key difference between these criteria and those used for
international standards from ITU is the emphasis here on operational
experience.
5.2.3 Kerberos:
In any network environment, any client can apply to any server for
service. The obvious security risk is that of impersonation. An
opponent can pretend to be another client and obtain unauthorized
privileges on server machines.
[The portion to the left of the colon indicates the sender and
receiver; the portion to the right indicates the contents of the
message, the symbol Il indicates concatenation.]
IDCIIPCII/
Ticket
IDCllTicket
Ticket = E(Kv, [IDCI IÅDCI IIDV])
Where C = client
AS = authentication server
V —server
(1
) AS IDC111Dtgs
(2
E(Kc, Tickettgs)
Once per type of service:
(3 IDC111DVlITickett
) C-+TGS gs
(4
) TGS—C Ticketv
Once per service session:
IDClITicketv
Tickettgs = E(Ktgs, [IDCllADC111DtgsIITS111Lifetime1])
Ticketv E(Kv, [IDCllADCll/DvlITS211Lifetime2])
The new service, TGS, issues tickets to users who have been
authenticated to AS. Thus, the user first requests a ticket-granting ticket
(Tickettgs) from the AS. The client module in the user workstation
saves this ticket. Each time the user requires access to a new service,
the client applies to the TGS, using the ticket to authenticate itself.
The TGS then grants a ticket for the particular service. The client
saves each servicegranting ticket and uses it to authenticate its user to
a server each time a particular service is requested. Let us look at the
details of this scheme.
1. The client requests a ticket-granting ticket on behalf of the user
by sending its user's ID and password to the AS, together with
the TGS ID, indicating a request to use the TGS service.
2. The AS responds with a ticket that is encrypted with a key that is
derived from the user's password. When this response arrives at
the client, the client prompts the user for his or her password,
generates the key, and attempts to decrypt the incoming message.
If the correct password is supplied, the ticket is successfully
recovered.
Authenticatorc = [IDCllADClITS3])
(b) Ticket-Granting Service Exchange to obtain service-granting
ticket
(1) C —+V TicketvllAuthenticatorc
(2) C [TS5 + 1]) (for mutual authentication)
Ticketv = E(Kv, [Kc,v111DcIlADc111DvIlTS411Lifetime4])
Authenticatorc =
(3)C—+ TGS:IDtgsremllTickettgsllAuthenticatorc
C:E(Kc,tgs, [Kc,tgsrem111DtgsremllTS411Tickettgsrem])
(5)C —YTGSrem: IDvremllTickettgsremllAuthenticatorc
Vrem:TicketvremllAuthenticatorc
Kerberos Version 5:
Kerberos Version 5 is specified in RFC 1510 and provides a number of
improvements over version 4.
• Spam
• Virus
• Phishing
Spam
E-mail spamming is an act of sending Unsolicited Bulk E-mails
(UBI)which one has not asked for. Email spams are the junk mails
sent by commercial companies as an advertisement of their products
and services.
Virus
Some emails may incorporate with files containing malicious script which
when run on your computer may lead to destroy your important data.
Phishing
Email phishing is an activity of sending emails to a user claiming to
be a legitimate enterprise. Its main purpose is to steal sensitive
information such as usernames, passwords, and credit card details.
Such emails contains link to websites that are infected with malware
and direct the user to enter details at a fake website whose look and
feels are same to legitimate one.
5.4 IP Security
High quality The baseline for security through IPsec must be set high
enough to guarantee a reasonable degree of actual security.
Cryptographically based Cryptographers work with algorithms for
encryption, secure hashing, and authentication.
Authentication Procedures:
X.509 also includes three alternative authentication procedures
that are intended for use across a variety of applications. All these
procedures make use of public-key signatures.
It is assumed that the two parties know each other's public key,
either by obtaining each other's certificates from the directory or
because the certificate is included in the initial message from each
side.
(b)Two-way authentication
IDÐ.sgnData.
Three-Way Authentication:
In three-way authentication, a final message from A to B is
included, which contains a signed copy of the nonce rB. The intent
of this design is that timestamps need not be checked: Because both
nonces are echoed back by the other side, each side can check the
returned nonce to detect replay attacks. This approach is needed
when synchronized clocks are not available.
X.509 Version 3:
The X.509 version 2 format does not convey all of the information
that recent design and implementation experience has shown to be
needed. The following requirements not satisfied by version 2:
• Confidentiality Authentication
• Network Security
SSI Confidenüalüy
If a client sends an XML request to a server, can we ensure that the
communication remains confidential?
5.52 Authentication
If a client connects to a web service, how do we identify the user? Is the
user authorized to use the service?
administered
network public
trusted "good guys" Internet
untrusted "bad
firewall guys"
Deploying firewall at network boundary is like aggregating the
security at a single point. It is analogous to locking an apartment at the
entrance and not necessarily at each door.
The decision can be based on factors other than IP header fields such as
ICMP message type, TCP SYN and ACK bits, etc.