Professional Documents
Culture Documents
DATA COMMUNICATION
Digital Signal
Synchronous
In synchronous serial transmission gaps are
not allowed between bytes.
No additional bits will be transmitted only data
bits are transmitted.
Sender and receiving clock are synchronized at
bit level.
Asynchronous
In asynchronous serial transmission gaps are
allowed between consecutive bytes.
In this transmission, in each byte atleast 2 bits
are added :
(a) Start bit
(b) Stop bit
S=N
It is not self synchronized and it contain DC
component.
NRZ-L (Non Return to Zero Inversion Method)
Bit 1 : Inversion
Bit 0 : No Change
S=N
It is not self synchronized but contains DC
component.
(ii) RZ (Return to Zero) : In this signal always
return to zero. In this method, the bit '1' represented by
positive to zero level and bit '0' represented by negative
to zero.
1
r
Here 2
S = 2N
It is self synchronize and contain DC component.
(iii) Biphase : In this signal is inverted at the middle
of bit interval.
(1) Manchester : In this technique a bit '1' is
represented by negative to positive and bit '0' is
represented by positive to negative.
1
r
Here 2
S = 2N
It is self synchronized and no DC component is
there.
Manchester technique invested a signal at the
middle of bit interval for both :
(a) Bit Representation
(b) Synchronization
(2) Differential Manchester : In this technique, the
signal is inverted at the middle of the bit interval for
synchronization.
Bit '0' represented by inversion at beginning of bit
interval and Bit '1' represented by non-inversion at
beginning of bit interval.
1
r
Here 2
S = 2N
In this technique
Self Synchronization (Yes)
DC component (No)
(c) Bipolar : In this technique we use following
method :
(1) AMI (Alternate Mark Inversion)
(2) Pseudoternary
(3) B8ZS
(4) HDB3 (High Density Bipolar Three Method)
(1) AMI : In AMI,
bit '1' : Inversion
bit '0' : Zero voltage
r=1
S=N
In this
Self Synchronisation (No)
DC component (No)
(2) Pseudoternary (Opposite of AMI) :
Bit '1' : Zero Voltage
Bit '2' ; Inversion
S=N
In this
Self Synchronisation (No)
DC component (No)
(3) B8ZS (Bipolar Zero 8 Substitution Method) :
It is an extension of AMI method. It resolves the problem
of synchronization of AMI. In this method 8 consecutive
zero's are replaced by a specific pattern and this pattern
depends upon the polarity of previous non-zero voltage
level.
Case-I : When polarity of previous pattern is
positive
0, 0, 0, +ve, –ve, 0, –ve, +ve
Bw = fmax – fmin
200 = fmax – 0
fmax = 200 KHz
Sampling rate = 2 × 200 = 400 KHz
(2) PCM :
In this method three steps are used :
Step-1 : Perform Sampling
Step-2 : Quantization
Step-3 : Binary Encoding
The Quantization is a process of assigning sub
integral value to each sample.
The Integral value will be depending on number
of bits are used to represent each sample.
Example : 3 bit for each sample
23 = 8
If Vmax = 20 V
Vmin = – 20 V
V Vmin
max
L (L : No. of Integral Values)
20 20
5V
So, 8
Conclusion
The baseband and broadband transmissions are
the types of signalling. Baseband transmission uses
digital signalling and involves digital signal or electrical
impulse that can be carried in a physical media such as
wires. The broadband transmission uses analog
signalling which involves optical signals or signals in the
form of an electromagnetic wave. Baseband
transmission utilizes the whole bandwidth of the channel
to transmit a signal whereas in broadband transmission
the bandwidth is divided into variable frequency ranges
to transmit the different signals at the same instant.
Multiplexing
Multiplexing combines multiple analog or digital
signals bound for transmission through a single
communication channel.
Types of Multiplexing
1. Frequency Division Multiplexing (FDM)
FDM is an analog multiplexing that combines
analog signals.
M o du lato r
f1
+
f2
f3
2 TX 1 , 2, 3 ... m RX 2
n TX RX n
MUX
Wavelength Division M ultiplexing
Transmission Media
Below physical layer but is under its direct
control.
Transmission media is anything that carry
information from source to destination.
Guided Media
1. Twisted Pair Cable
It consists of two conductors (normally copper) each
with its own plastic insulation twisted together.
m o re d ense
I
Radio Wave
Omnidirectional i.e. signal flows in all direction
so, receiving & transmitting antennas need not
be aligned.
It can penetrate walls.
Long distance used in AM radio.
Applications include multicasting, AM, FM,
television, maritime radio, cardless phone,
paging.
Micro Wave
Unidirectional i.e. signal flows in a single
direction thus, antennas need to be aligned.
Very high frequency microwaves can not
penetrate walls.
Microwave bond is wide, thus can be sub
divided and higher data rate is possible.
Applications include unicast in cellular phones,
satellite networks, wireless LANs.
Infrared (300 GHz – 400 THz)
It is useful for short range communication
They cannot penetrate walls.
Infrared cannot be used outside a building
because sunlight contain infrared waves that
can interfere with communication.
Application include keyboards, mouse, PCS
and printers.
Parity Bit
In this one bit control information is appended as a
least significant bit with data word to be produced
Length of code word = [Length of dataword + 1]
Even parity - The number of 1’s within the code
word must be same even number
E.g.1 Dataword 11110000
Codeword 1 1 1 1 0 0 0 0 0
E.g.2 Dataword 10001111
Code word 1 0 0 0 1 1 1 1 1
At the receiver end in this method, the receiver
counts the number of 1’s within the received
codeword.
If it is even no error otherwise error
Advantage
(1) The parity code can detect all single bit errors.
(2) The even parity code can detect all burst errors
with odd having distance.
Limitation
This code cannot detect burst error with even
hamming distance.
Odd parity
The number of one’s within code word must be odd.
E.g. : Dataword 11110000–
Codeword 1 1 1 1 0 0 0 0 1
Dataword 10001111
Codeword 1 0 0 0 1 1 1 1 0
CRC Cyclic Redundancy Check
The various steps are
(1) Prepare a binary stream for the given
polynomial/generator polynomial g(x)
(2) Append n zero’s at the least significant position
of the given dataword.
Where n is degree of the given polynomial g(n)
Suppose polynomial is x3 + 1 n = 3.
(3) Perform binary division operation between
the binary number generated in step 1 and step
2
(4) The reminder is the CRC bits, that we
append at least significant bit of data word, to
produce the codeword.
CRC Checker
The receiver performs binary division operation
between received codeword and given polynomial.
If reminder is zero that means no error otherwise
error
Length of codeword = [Length of dataword + n]
0011
0000
0111
0000
1110
1001
1110
1001
1110
1001
1110
1001
1 1 1 R e m in de r
Receiver Side
1001 1000110111 1001111
1001
0011
0000
0111
0000
1110
1001
1111
1001
1101
1001
1001
1001
1011
1001
01000
1001
001100
1001
1010 CRC = 0 1 1
1001
011
111011
1 1 0 1 0 1
111010
1 1 0 1 0 1
111110
1 1 0 1 0 1
101100
110101
111010
110101
01110
Remainder is 0 1 1 1 0
Correct option is (A).
Checksum
In checksum error detection scheme,
Sender Side
1. The given dataword is divided into n bits where
n length of checksum.
2. Perform binary addition operation to produce
the sum.
If sum contains a carry then that carry is also
added
3. Take the one's complement of the sum. This
one's complement of the sum is checksum.
These checksum bits will be appended to the
least significant bit within data word to produce
code word.
Receiving end
4. The receiver decompose the received
codeword into group of n bits perform the
binary addition.
5. If sum contains a larry, then that carry will also
be added to the sum.
6. Finally the receiver takes the one's
complement of sum and check whether value is
zero or not.
If it is zero then no error otherwise error
Advantage : It can detect all single bit errors.
Limitation : It can detect burst errors only upto
length 'n'
Example : Dataword is 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0
1 00001111
n=8
Sender
0 1 0 0 0 0 1 0
0 1 0 1 0 1 0 1
() 0 0 0 0 1 1 1 1
1 0 1 0 0 1 1 0
Checksum 0 1 0 1 1 0 0 1
Receiver : 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 0 0 1 1
11010111001
n=8
0 1 0 0 0 0 1 0
0 1 0 1 0 1 0 1
0 0 0 0 1 1 1 1
0 1 0 1 1 0 0 1
1 1 1 1 1 1 1 1
Complement = 0 0 0 0 0 0 0 0 (no error)
Example : Let dataword be 10110011 10101011
01011010 11010101
n=8
Sender Receiver
10 1100 11 (1 )
10 1100 11 (1 ) 10 1010 11 (2 )
10 1010 11 (2 ) 01011110
01 011110 +1
+1 01 011111
01 011111 010110 10 (3 )
01 0110 10 (3 ) 10 111 00 1
10 111 00 1 11 01 01 01 (4 )
11 0101 01 (4 ) 1000 111 0
1
10 00 111 0
1 1000 1111
S um : 10 00 1111 01110 00 0 (5 )
C h ecksum 01110 00 0 (5 ) S um : 11111111
C o m ple m e nt = 0 00 00000
(N o E rror)
Two-Dimensional Parity Check
This technique organised a number of binary
words being transmitted or received in
succession along two dimensions that is row
and columns.
Two sets of parity bits are computed
Rows of data block Longitudinal
Redundancy Check (LRC)
Columns of data block Vertical Redundancy
Check (VRC)
The parity bits are added to make sure the
parity should be even/odd
E.g.: Let Data be –
D ata P arity
0 1 0 0 0 1 1 1 0
0 1 1 0 1 1 1 1 0
0 1 1 0 1 1 1 1 0
0 1 1 0 0 1 0 0 1
0 0 1 0 0 0 1 1 1
0 0 1 0 0 0 1 1 1
od d p arity
m bits r bits
n=m +r
Other Terms
Hamming Distance : It is the number of bit
positions in which two code words differ
100101
101010
Hammin g Dis tan ce 4
Dmin : The smallest hamming distance between all
pairs of the code words is called min. Hamming
distance.
It is also equal to min Hamming weight (other than
0) of all codewords
Suppose, 0000
0111
0110
1100
1110 are the code words, what is the
minimum distance (dmin)
0000 H(w) = 0
0111 H(w) = 3
0110 H(w) = 2
1100 H(w) = 2
1110 H(w) = 3
Where, H(w) is hamming weight
dmin = 2
The minimum distance can,
(a) Detect S-error
Dmin S + 1
(b) Correct t errors
Dmin 2t + 1
(c) Can detect S errors & correct t errors
simultaneously
Dmin S + t + 1
(A) 0 (B) 1
(C) 2 (D) 3
Sol. (D) H(w) is hamming weight
00000000 H(w) = 0
00001111 H(w) = 4
01010101 H(w) = 4
10101010 H(w) = 4
11110000 H(w) = 4
dmin = 4
So, dmin 2t + 1
4 2t + 1
3 2t
3
t 2
t 1.5
So, 1 error can be corrected.
So, 1 0 0 1 1 1 0
2. Parity bits need to be calculated
For P1 use D3 D5 D7 D9 D11 01101
Thus, For even parity P1 = 1
For P2 use D3 D6 D7 D10 D11 01101 P2
=1
For P4 use D5 D6 D7 111 P4 = 1
For P8 D9 D10 D11 001 P8 = 1
Thus, hamming code transmitted,
(10011111011)
E.g. 2 Find Hamming code for dataword 0111. Even
Parity
D7 D6 D5 P4 D3 P2 P1
D 1 1 1
C1 : P 1 D 3 D 5 D 7 D 9 : 1 1 1 0 1 (even)
C1 = 0
C2 : P 2 D 3 D 6 D 7 0 1 0 0 (odd) C2 = 1
C4 : P 4 D 5 D 6 D 7 0 1 0 0 C4 = 1 (odd)
C8 : P 8 D 9 1 1 C8 = 0 (even)
C8 C4 C2 C1
Thus,
th
0 1 1 0 6 thus 6 bit is in error
Correct Codeword is
(110110101) Ans.
C1 : 1, 3, 5, 7 C1 : 1, 1, 1, 0 C1 = 1
C2 : 2, 3, 6, 7 C2 : 0, 1, 1, 0 C2 = 0
C4 : 4, 5, 6, 7 C4 : 0, 1, 1, 0 C4 = 0
C4 C2 C1
0 0 1 1st bit is in error.
2. COMPUTER NETWORKS
M e sh S ta r B us R in g
1. Mesh: In this every system is connected to
every other system by a dedicated link or
channel.
1 2
3 4
5 Hub 2
4 3
S ha red C ab le
drop line s
Advantage
1. Ease of installation
2. Less Cabling
Disadvantage
1. Increase collision, so protocol like
CSMA/CD will be required
2. Difficult reconnection and fault isolation.
Application : Ethernet LANs
4. Ring Topology : Single shared medium on a
circular ring. Stations gain access to token &
can then only send the data.
M onito r
S ta tion
S ta tion A
S ta tion C
S tation B
In this there is no possibility of collision as
token is circulated.
Advantage
1. Easy to install and reconfigure.
2. Even if a device is not working it can issue
alarm, the network operator can see
problem and locate error.
Disadvantage
1. Unidirectional Traffic
2. Break in ring cause problem.
Application : LAN
Categories of Network
Netw ork
Wireless Networks
Wireless communication is one of the fastest
growing technologies. Wireless LANs can be found on
college campus, in office buildings and in many public
areas.
One of the standard for wireless LANs is
IEEE802.11 and Bluetooth, a technology for small
wireless LANs.
S erve r
or
D istrib utio n S yste m ga tew a y
AP AP AP
BSS BSS B SS
S econ da ry
Scatternet
Internetwork
The ability to share information over dissimilar
network is known as internetwork. By using a set of
standards, nodes in two (or more) data network can
share information reliability.
LA N R LA N
R R
LA N R W AN R LA N
R R
LA N R MAN
Internetw ork
internet vs Internet
(lowercase 'i') (upper case 'I')
An internet is a group of distinct network connected
to one another via a gateway. Any network that confirms
to standard defined in TCP/IP is an internet.
The Internet : In addition to world wide web (www),
it consists of a world wide collection of networks,
including academic institutions, government
organisations, various public as well as private network.
Intranets
An Intranet is an IP-based network that is
administered and controlled by a single entity. An
intranet is a controlled network, with only users who
have authorization to be on the network granted access
to it.
Example : A corporate LAN.
In intranet, security (firewall, encryption) is in place
this allows remote users to access applications over the
internet, while preventing unauthorized users from
gaining access.
Extranets
An extranet is an intranet that is opened up to allow
outside users access to intranet. The access normally is
provided by a server, which clients access over the
internet.
Virtual Private Network (VPN)
A VPN is an extranet that securely connects
separate networks to one another, as well as individuals
to networks.
VPN technology uses a public network (normally
internet) to connect users and networks to one another
in what are known as tunnels
VPN tunnelling protocols include :
Generic Routing encapsulation (GRE)
IPSEL
Tunnelling protocols like PPTP, L2TP
These tunneling protocols ensure that data is
encrypted on sending end of tunnel and is decrypted at
the receiving end of the tunnel.
3. NETWORK MODELS
Layered Architecture
The basic elements of a layered model are
services, protocols and interfaces. A service is a set of
actions that a layer offers to another (higher) layer.
Protocol is a set of rules that a layer uses to exchange
information with a peer entity. These rules concern both
the contents and the order of the messages used.
Between the layers service interfaces are defined. The
messages from one layer to another are sent through
those interfaces. In an n-layer architecture, layer n on
one machine carries on conversation with the layer n on
other machine. The rules and conventions used in this
conversation are collectively known as the layer-n
protocol.
OSI Reference Model and its Protocols
International standard organisation (ISO) is
1947.
An ISO standard that covers all aspects of
network communications is the open system
interconnection Model (OSi) introduced in
1970.
An open system is a set of protocols that allows
any two different systems to communicate
regardless of their underlying architecture.
It is not a protocol, it is a model for
understanding and designing a network
architecture that is flexible, robust and
interoperable.
× ×
Interm ed ia te N od e
D e vice A D e vice B
P ee r to Pe er P roto col
7 A pp licatio n la yer A pp licatio n la yer
7-6 Interfa ce
6 P rese ntatio n la yer P rese ntatio n la yer
U se r
S up po rt
5 S essio n laye r S essio n laye r
H6 D6 H6 D6
H5 D5 H5 D5
H4 D4 H4 D4
H3 D3 H3 D3
H2 D2 T2 H2 D2 T2
H1 01 01 01 ........... 1 00 0 H1 01 01 01 ........... 1 00 0
Tran sm ission M ed ia
1. Physical Layer
It deals with the mechanical and electrical
specifications of the interface and transmission
media.
Functions of Physical Layer are :
(a) Physical Characteristic of Interface and
Medium
(b) Encoding
(c) Data Rate : No. of bits sent per second
(d) Synchronization of bits
(e) Physical Topology
(f) Transmission Mode : Simplex, Half Duplex &
Full Duplex
(g) Link Configuration : Point to Point, Multipoint.
2. Data Link Layer (DLL)
The Data link layer transforms, the physical layer (a
raw transmission facility) to a reliable link.
Functions of data value layer are :
(a) Framing
(b) Physical Addressing
Frames are to be distributed to different system
on network.
(c) Flow Control –
Rate at which data is absorbed at receiver is
less than that of sender.
(d) Error Control
Achieved using trailer
(e) Access Control
When multiple device access same link, which
device has access to the media.
E nd link X
syste m
A B
en d
Hop to H op delivery
link X link
syste m
H op E
to H
op
F
Hop to H op
Q. Match : [Net
2014]
List-I List-II
(a) Data Link Layer (i) Flow Control
(b) Network Layer (ii) Node to
Node Delivery
(c) Transport Layer (iii) Mail Service
(d) Application Layer (iv) Routing
Code :
(a) (b) (c) (d)
(A) (ii) (i) (iv) (iii)
(B) (ii) (iv) (i) (iii)
(C) (ii) (i) (iii) (iv)
(D) (ii) (iv) (iii) (i)
Sol. Correct Option is (B)
TCP/IP Model
TCP/IP Model was designed and developed by
Department of Defense (DoD) in 1960s and is based on
standard protocols. It stands for Transmission Control
Protocol/Internet Protocol. The TCP/IP model is a
concise version of the OSI model. It contains four layers,
unlike seven layers in the OSI model. The layers are:
1. Process/Application Layer
2. Host-to-Host/Transport Layer
3. Internet Layer
4. Network Access/Link Layer
The diagrammatic comparison of the TCP/IP and
OSI model is as follows:
Physical Addresses
The physical address, also known as the link
address, is the address of a node as defined by its LAN
or WAN. It is included in the frame used by the data link
layer. It is the lowest-level address. The size and format
of these addresses vary depending on the network. For
example, Ethernet uses a 6-byte (48-bit) physical
address that is imprinted on the network interface card
(NIC).
Most local area networks use a 48-bit (6-byte)
physical address written as 12 hexadecimal digits; every
byte (2 hexadecimal digits) is separated by a colon, as
shown below.
Example (2)
The following Figure shows two computers
communicating via the Internet. The sending computer
is running three processes at this time with port
addresses a, b, and c. The receiving computer is
running two processes at this time with port addresses j
and k. Process a in the sending computer needs to
communicate with process j in the receiving computer.
Note that although both computers are using the same
application, FTP, for example, the port addresses are
different because one is a client program and the other
is a server program.
Circuit Switching
Advantage
Resource utilization better.
Disadvantage
Delay on compared to circuit
Reordering and unreliable (in case of
datagram)
Total time take for sending data :
m d
(x 1) (n 1)
B V
x = routers
n = wires
m
B = transmission delay.
d
V = propagation delay
Note :
If setup up time is greater than transmission
delay use virtual circuit approach.
If setup time is small, circuit switching is better.
Message Switching
Whole message is stored at a switch and then
forward to next.
E.g. Email
Q. Which one of the following statement is False ?
(Gate 2004)
(A) Packet switching leads to better utilization of
bandwidth resource than circuit switching.
(B) Packet switching result in less variation in delay
than circuit switching.
(C) Packet switching requires more per packet
processing than circuit switching.
(D) Packet switching can lead to reordering unlike
in circuit switching.
Sol. (B)
Framing
Framing means breaking the bit stream into frames.
fram e fram e
Tim e
ga p
sta rt of En d o f
fram e fram e
0 0 0 0 0
F or n oisele ss F or n oisy
cha nn el cha nn el
S im plest – stop an d w ait A R Q
S to p and w ait – G o B A C K -N A R Q
– S ele ctive R e peat A R Q
d a ta
-1
0
ack -
d a ta
-0
1
ack -
Efficiency, ()
total time spent in transmitting
Total cycle time
Tt
Tt 2Tp
1 Tp
where a
1 2a Tt
Tp
1
Q. If efficiency in stop and wait ARQ then
2
Tt = 2 × Tp
Note : If Tt > 2Tp is greater than ½. If T t is
very less than Tp more time is spent in
travelling thus efficiency is less.
tt = 2 t p
M
= 2 tp M = 2 × 20 × 10–3 × 64 × 103
B
= 2560 bits
M = 320 bytes Ans.
Q. What is the window size for stop and wait protocol
for sender & receiver.
Sol. Sender window size = 1
Receiver window size = 1
tt = 10–3 sec
tp = 10ms
tp
a
tt
10 10 –3
a
10 –3
a = 10
1
1 2a
1
1 20
1
21
1
% 100 5%
21 Ans.
go ba ck N S ele ctive R ep ea t
Here,
Tt 2 Tp
Window size = Tt
window size 1 2a
ws
i.e.
The minimum number of bits required in
Sequence number for window log2 ws
Here, efficiency
ws
1 2a
1 2 100
201 ms
1
No. of bits required = [log2 201]
= 7 bits.
But,
Window size = min (1 + 2a, 2 n) in case (efficiency)
is not 100%
= min (201, 27)
= min (201, 128)
Ws = 128
(b) Calculate the efficiency
Ws
1 2a
128 128
1 2 t p 1 2(100)
tt 1
128
201
0.63
Ans.
Go-Back N : where N is window size (Conservative
protocol)
For Go BACK N
Sender window size (N) = 2n – 1
Receiver window size = 1
n = sequence number bits
N
1 2a
0 1 2 3
ws
da ta 0
0 1 2 3 0 1
WR
ack 1
0 1 2 3
0 1 2 3 0 1
d a ta
1
x
d a ta WR
0 1 2 3 0 2
x
0 1 2 3
d a ta
3
x
0 1 2 3 0 R e tran sm its
d a ta
1
Rn
tim e o ut
ack 2 0 1 2 3
0 1 2 3 0 1
80 10 3
a B
M
80 10 3
a 128 103
32 8
a = 40
Window size = 1 + 2a
= 1 + 2(40)
= 81
No. of bits required = [ log2 81 ]
No. of bits 7 bits
Ans.
N = 1 + 2 × 2 × 50
N = 201
No. of bits required = [ log2 ws ]
= [ log2 201 ]
m = 8 bits
* as, full 201 packets can be sent with n = 7 bits
only 128 packets can be sent.
1 + 2a = 508
507
a= 2
15210 507
x 2
15210 2
x
507
x 60 bytes
Ans.
Tp = 400 ms.
Tp 400
a 10
Tt 40
ws 10 10
1 2a 1 20 21
Data Rate = × BW
10
20 kbps
21
d a ta
2
d a ta
3
erro r
K3
NAC
d a ta
3
10000 106
10 106
100
a = 100
Window size = 1 + 2a = 1 + 2(100)
= 201
No. of bits required = log2 201
No. of bits required = 8 bits
WS WR
In go - back N 28 1 1
WS = 255 WR = 1
In Selective Repeat 28–1 28–1
WS = 127 WR = 127
1 0 means s-frame
2. Code (2-bit)
00 – Receiver Ready (RR)
acknowledge the receipt of a safe and sound
frame
10 – Receiver not Ready (RNR)
It acknowledge the receipt of a frame and it
announces that the receiver is busy and cannot
receive more frames.
01 – Reject (REJ)
It is NAK used in GO-BACKN
11 – Selective Reject (SREJ)
It is NAK used in selective repeat.
1 1 P /F U -Fram e
C ode C o de
It does not contain user data, but management info.
Some common type of command are –
Code
00 001 SNRM – Set normal response mode
00 110 UA – Unnumbered acknowledgement
00 010 RD – Disconnect
11 001 Reset
10 001 FRMR – Frame reject
Carrier Sense Multiple Access (CSMA)
To minimum collision CSMA was developed. The
chance of collision reduces if station senses the medium
before trying to use it.
CSMA requires that each station should first listen
to the medium before sending. i.e. sense before sending
or listen before talk.
CSMA can reduce collision but cannot eliminate it.
The possibility of collision exists due to propagation
delay.
So, vulnerable time CSMA is propagation time : TP
Persistence Methods
What if the channel is busy ?
(1) 1-Persistent : In this, after the station finds the
line if sends frame immediately with a probability 1. This
method has highest chance of collision.
(2) Non-Persistent : In this a station that has frame
to send senses the line. If line is idle sends immediately.
If line is not idle waits for random time and senses line
again.
Collision will be there if the station waits for
some random time.
This method reduces the efficiency of network
because medium remains idle when there are
many station to send.
(3) P-Persistent : This method is used when the
channel has time slots with slot duration equal to or
greater than maximum propagation time.
This method reduces the chance of collision as
well as improves efficiency.
In this method, after the station finds the station
idle does the following :
1. With probability P sends its frame
2. With probability q = 1 – p station waits for
beginning of next time slot and checks line
again :
(a) If the line is idle go to step 1.
(b) If line is busy, it acts as though
collision has occurred and uses back
off procedure.
(a) 1-Persistent
if N
1
A
e
V 20000
Controlled Access
In controlled access the stations consult one
another to find which station has the right to send. A
station cannot send unless. It has been authorized by
other stations. Methods :
(a) Reservation : A station makes a reservation
before sending data. Time is divided into intervals. In
each interval, a reservation frame proceeds the data
frame sent in the interval.
If there are N stations, there are exactly N
reservation minislots in the reservation frame. Each
minislot belongs to a station. When a station needs to
send a data frame, it makes a reservation in its own
minislot.
Example
(b) Polling : Polling works with topologies in which
one device is designated as a primary station and other
as secondary stations. Primary device control the link.
If primary wants to receive data, it asks
secondaries. If they have anything to send this is called
poll function. If the primary wants to send data, it tells
the secondary to get ready to receive. This is called
select function.
1. Repeater
1. Repeater can extend physical length of LAN
like 10 Base 5 is limited to 500 m
R e pe ater
B D
A sen ds to C bu t a ll rece ives it
C D
A a A dd P ort
d B1 B2
a A b
d d c
be cau se o f lo op
B1 B2
1 2
B3
2 2
LA N 2 LA N 3
1 1
3
B4 B5
2 2
LA N 4
Note : In routers to avoid loops we use field called
TTL, In DDL-spanning tree bridge
B1 is root bridge
Root port
for B2 1
B3 1
B4 1
B5 2 (for it both 1, 2 are at same
distance)
Designated Bridge
LAN 1 B1
LAN 2 B1
LAN 3 B2 or B3 (take small Id) So, B2
LAN 4 B3
Designated Port
B1 1
B1 2
B3 3
B2 2
So
S pa nn ing tre e is
1
B1 B2 M a rked w ith
2 B3 ( )
1
B4 3 B5
N o loop s
Switch (2.layer)
Instead of connecting LAN to host connect host
directly
O
O O
S w itch O
O O
O
Gateway
It operates at all the 5 layers
Connect devices between two inter networks
It can provide the following features
(a) Protocol conversion
(b) Proxy
(c) NAT / Network address translation
(d) Firewall
(e) DPI – Deep Packet Inspection
(f) Buffer Management
(g) Slow down high speed servers
Broadcast Domain & Collision Domain of all Devices
Broadc a s t Domain Collision Domain
Re peater Same Same
Hub Same Same
Bridge Same Re duces
Switch Same Re duces
Router Re duces Re duces
Gateway Re duces Re duces
IP (Network Layer)
Application Layer Sends data of any
size
(Data is fragmented into
65495 B each)
Transport Layer (TCP)
Network Layer
IP (Internet Protocol)
For delivery of packets (host to host delivery) at the
network layer and for routing packets.
IPv4 (Inter Protocol version 4) delivery protocol used
by TCP/IP.
IPv4 is unreliable and connection less datagram
protocol best effort delivery.
If reliability is important, IPv4 is paired with TCP.
D = Minimize Delay
T = Max Throughput
R = Max Reliability
C = Min Cost
Eg. : Default service
SMTP 0100 Max Throughput
TLENET 1000 Min delay
Bits Used in Fragmentation
(1) Identification
When datagram is sent it is given a value. When
that datagram is fragmented, then that value is copied to
all its fragment.
(2) Flags
Ex.1
IPv6 (128 bits)
PRI (Priority)
Extension Headers
(1) Hop by Hop Option : Source needs to pass
information to all routers visited by IP datagram.
(2) Fragmentation : Same as IPv4, but in IPv6 only
source can fragment the data.
(3) Authentication
(4) Encryption Security Payload (ESP)
(5) Destination Option : Source need to pass
information to destination only.
Transport Layer (UDP/TCP)
UDP (User Datagram Protocol)
UDP is called connectionless unreliable transport
protocol. It does not add anything to services of IP
except to provide process to process communication.
IP Addressing
An IP address is a numerical label assigned to each
device connected to a computer network that uses
internet protocol of communication.
IPv4 defines an IP address as a 32-bit number.
There are two notations in which IP address is
written :
Dotted decimal notation
Hexadecimal notation
Dotted Decimal Notation
Hexadecimal Notation
Special Address
(1) Directed Broadcast to the Network : Received
by all host connected to the network.
[<net id> <all 1's>]
Eg. : 193 . 168 . 2 . 255,
129 . 22. 255 . 255
(2) Limited Broadcast : (Called limited because
routers are not allowed to forward then) Just used host
startup.
[<all 1's> <all 1's>]
i.e. Eg. : 255 . 255 . 255 . 255
(3) This Network, This Host : Used by a host at
bootstrap time when it does not know IP address.
[<all 0's> <all 0's>]
(4) A Host on this Network :
[<all 0's> <host id>]
(5) Loopback Address : It is used to test the
communication or medium.
[127 . <any>]
First host 24 . 0 . 0 . 1
Last host 24 . 255 . 255 . 254
[24 . 0 . 0 . 0 and 24 . 255 . 255 .
255 are reserved]
Sub Netting
In this a network is divided into smaller subnetworks
having its own subnetwork address.
It increases the number of 1's in the network id that
is borrowed from the host ids.
AIM of Subnetting
Is to minimize wastage of IP addresses.
Subnet Mask
The number of 1's in a default mask is
predetermined. In a subnet mask the number of 1's is
more than the corresponding default mask.
Number of Subnetworks
It can be found by counting the number of 1's that
are extra. Eg : in above 3, 1's are extra.
So, no. of subnetwork = 23 = 8
Super Netting
Class A and B are almost depleted Class C address
are still available. However size of Class C is 256
addresses that are too less to satisfy needs of an
organisation.
Solution is Supernetting & Organisation can
combine several C block to create a larger range of
addresses.
If decreases the number of 1's in the default mask.
Q. If the subnet mask of class B is 255 . 255 . 240 . 0.
Calculate no. of subnets and no. of host in each
subnets.
Sol. Default = 255 . 255 . 0 . 0
11111111 . 11111111 . 00000000 . 00000000
11111111 . 11111111 . 11110000 . 00000000
No. of subnets = 24 – 2 = 14
No. of hosts = 212 – 2 = 4094
Routing
It is the process of creating routing tables for the
purpose of forwarding.
Routing
P ath Ve cto r
D istan ce Ve cto r Link sta te R o uting
R o uting (D V R ) R o uting
BGP
R IP OSPF (B orde r G ate w a y
(R o utin g Inform atio n (O pe n S ou rce P roto co l)
P roto co l) S ho rtest P ath
F irst)
7
1 3
A 2 B
Steps 1 :
Each router makes its own routing table initially.
A Dert Next hop B C
A 0 A A 2 A A
B 2 B B 0 B B 3 B
C C 3 C C 0 C
D 1 D D 7 D D 11 D
D
A 1 A
B 7 B
C 11 C
D 0 D
Steps 2 :
Each Router will share routing table with its
neighbours only & update according to them.
At C :
C ' s table D ' s table B ' s table
A A 1 A 2
B 3 B 7 B 0
C 0 C 11 C 3
D 11 D 0 D 7
11 3
(C reach D by 11) (C reach B by 3)
So,
via via via
C C D B
A 12 5 minimum of these
B 3 18 3
C 0 22 6
D 11 11 10
C new table
A 5 B
B 3 B
C 0 C
D 10 B
Problem
DVR suffers from count infinity problem (Bad news
travel late)
2 4
X A B
X 2 – X 6 A
4
X A B
X – X 6 A
4
X A B
X 10 B X 6 A
Solutions
(1) Define infinity Define infinity as large value
such as 16.
(2) Split horizon Only sends part of table. If B
knows optimum route to X via A, does not
advertise to A.
(3) Split horizon with poison reverse
advertise the value with “do not use this value”
RIP Routing information protocol is an intra
domain routing protocol. It is based on DVR with
Following considerations —
(a) Infinity is defined as 16.
(b) Metric used to measure distance is hop count.
C D
E G
F
Sol.
A B C D E F G
F via A 8 48 22 25 29 0 32
F via D 32 20 42 12 26 0 34
Q. Linked Questions
Consider a network
7
R2 R4 8
6
R1 2 1 R6
4
9
3 R3 R5
R1 - R6
R1 2 1 R6
3 4
9
R3 R5
4 6
2
N4 N3
3 C
4
D E
Steps :
(1) Creation of LSP packet
LSP of A
Identification
Age (TTL)
B 5
C 2
D 3
3 C 3 Top olog y
4
D E
C 2 2 C
3 D 3 D E 6
(a ) (b ) (c)
0 A B 5 0 A B 5
C 2 2 C
3 D E 3 D E 6
(d ) (e )
S ho rtest p ath tre e
Disadvantage
(1) Need lot of resources
(2) Heavy traffic due to flooding.
OSPF (Open Source Shortest Path First)
Metric - OSPF allow administrator to assign a cost
to each route based on type of service like minimum
delay, maximize throughput.
Path Vector Routing
It is similar to distance vector routing, in this we
assume there is one node in each autonomous system
(System under one administration) that acts on the
behalf of entire autonomous system. It is called speaker
node.
Only speaker node communicate with each other
A S1 AS3
A2 A3 C2 C3
A4 A1 C1
AS2 A S4
B 1 Tab le
B3 D1 D4
B1 AS2
B2 AS2 B1
B3 AS2
B4 AS2
B2 B4 D2 D3
A1 B1 B4
A4 A5 B2
R2
R1 R5 R6
C lu ste r 1
R4 R3 R7
R e gio n 3 R e gio n 4
R8 R9
C lu ste r 2 R 12 R 13
R 11 R 10
Let x Clusters
y Regions
z Routers
Number of entries at each router.
z (y 1) (x 1)
S yn + a ck
(se q 15 00 0
Ac a ck 8 00 1)
(S e q
8000 k
ack 1
5001
)
S yn A ck
1 0 R e qu est
1 1 R eply
0 1 P ure P ig gy B acking
S eq = 15 00 1
ack = 10 00 1
D a ta (15 00 1 – 1 70 00 )
Tim e
F in + A ck
A ck
Half Close
One end can stop sending data while still receiving
data.
C lie nt F in S erve r
A ck
D a ta
A ck
F in
A ck
SYN + ACK
ACK
Flow Control
Flow control balances the rate of producers creates
with the rate at which a consumer uses the data.
To achieve flow control, TCP forces sender and
receiver to adjust their window sizes although
size of buffer for both parties is fixed when
connection is established.
C lie nt 00 S erver
adv = 10
10 00 B
d a ta = 1
00 B
90 0
0
adv = 90
d a ta =
700
0 20 0
adv = 20
da ta = 2 00
adv = 0
P ersiste nce tim e dum m y D u m m y segm en ts are
sen t w h en clien t
can ’t se nd no rm a l
seg m e nts
Window Shutdown
Instead of shrinking the send window, the receiver
can temporarily shut down the window by sending rwnd
of 0. This happens if receiver does not went to receive
data for some time.
Even when window is shut down from receiver,
sender can always send 1 byte of data. This is called
probing & used to prevent a deadlock.
Silly Window Syndrome
A serious problem occurs when either sender
produces data slowly or receiver receives data slowly.
E.g.-If TCP sends 1 bytes of data that means 41 byte
datagram (20 B of TCP header + 20 B of IP) to transfer
only 1 byte. Overhead in this case is 41/1. This is called
silly window syndrome.
Syndrome by Sender : If sender creates data
slowly, for e.g. 1 byte at a time. Solution would be to
wait & collect data before sending.
Nagle's Algorithm
1. When TCP data come into sender TCP one
byte at a time just send first byte as a single
TCP segment.
2. After that buffer all the data till either
acknowledgement is received or enough data
is accumulated till the maximum segment size.
Not useful in case of interactive applications.
Syndrome by Receiver : Receiver may create a
syndrome if it is consuming data slowly e.g. 1 byte at a
time.
Here,
R e ceive r bu ffe r is fu ll
R e ad 1 bytes data
R o om for o ne b yte
W in do w up da te sen t
N e w b yte arrives b y se nd er
R e ceive r bu ffe r fu ll
Clark's Solution
Prevent the receiver from sending a window update
for 1 byte of data.
The window is not advertised till there is enough
space to accommodate a segment of max size or until
half of receiver buffer is empty.
TCP Error Control
TCP provides reliability using error control. Error
control includes mechanisms for detecting & resending
corrupted segments, resending cost segments, storing
out or order segments.
TCP achieves this using
(1) Checksum
(2) Acknowledgement
(3) Time out
Checksum
TCP checksum is calculated for TCP headers,
TCP payload & pseudoheader.
If in transit, the IP header gets corrupted & IP
checksum gets modified. In such case, TCP
will detect error using pseudoheader. Also,
TCP doesn't calculate checksum for entire IP
header, just a part of header as, IP header
changes though transit.
(TTL, offset, options, MF, checksum)
Acknowledgement
TCP uses acknowledgements to confirm receipt of
data segments.
Ack segments do not consume
Acknowledgement type
1. Cumulative acknowledgement : Acknowledge
data cumulatively.
2. Piggybacking : ack with the data
3. Selective acknowledgement : It does not
replace ack but provides additional information
such as block of bytes duplicated or out of
order. SACK are implemented in TCP options.
Retransmission
The sending TCP maintains one retransmission
time out CRTO; for each connection. When timer
expires, TCP resends the data and restart the timer.
TCP uses a highly dynamic algorithm that
constantly adjust timeout interval.
Jacobson's Algorithm
Basic Algorithm
Estimated RTT = initial RTT + (1 – ) New
RTT
(round triptime)
0 1 is a constant
Time out = 2 RTT
Example : Let IRTT = 30 sec
NRTT = 40 sec
= 0.9
Estimated RTT = IRTT + (1 – ) NRTT
= 0.9 × 30 + 0.1 × 40
= 31 sec
Time out = 2 × 31
= 62 sec
Jocobson used another variable deviation (D).
Deviation is given by :
Whenever an acks comes in, its initial RTT & New
RTT is observed.
D = | IRTT – NRTT |
A smoothed value of Deviation is maintained,
D(estimated) = Dinitial + (1 – ) Dnew
Time out = RTT + 4 D(expected)
Example : Consider IRTT = 30 sec
NRTT = 40 sec
= 0.9
Initial Deviation (Di) = 5
Then D(new) = | IRTT – NRTT |
= |30 – 40|
= 10 sec
Deviation (expected) = Dinitial + (1 – )Dnew
= 0.9 × 5 + (1 – 0.9)10
= 5.5
RTT (expected) = IRTT + (1 – )NRTT
= 0.9 × 30 + 0.1 × 40
= 31
Time out = 4 × D(expected) + RTT (expected)
= 4 × 5.5 + 31
= 53
Karn's Algorithm
Consider a situation below
d a ta 1 d a ta 1
0 0
tim e o ut tim e o ut
d a ta 1 d a ta 1
0 0
A c k 11
11
k
Ac
Timers in TCP
1. Retransmission Timer
When a segment is sent a retransmission timer
is started.
If segment is acknowledged before timer
expires, the timer is stopped.
If timer goes off, then the segment is
retransmitted.
2. Keep alive Timer
It is used to check for connection integrity when it
goes off (because of long time of inactivity) one side
check of other side is available.
3. Persistence Timer
It is to avoid deadlock
Receiver sends a packet with window size = 0
latter it resends with larger window size but this
segment gets lost.
Both receiver & transmitter are waiting for each
other.
Persistence timer is used at the sender side, that
when goes off produces a probe packet & make receiver
advertised window once again.
4. Timed Wait State Timer
When connection is close, it runs for maximum
packet lifetime to make sure connection is closed & all
packets relating to this has died.
So, 12 segments.
Time taken = 12 × 100 msec = 1200 msec
6th 2 MSS
7th 4 MSS
8th 5 MSS
———— Threshold
9th 6 MSS
10th 7 MSS
Correct Option is (C)
R e qu est
w e b pa ge A
R e qu est
w e b pa ge A
Client (Browser)
These interprets and displays a web document. It
consist of 3 parts —
(a) Controller Receives input from keyboard &
use client program to assess the document.
(b) Client protocol One of the protocol is used
like FTP, HTTP
(c) Interpreters Display the document on the
screen.
HTM L
C lie nt
Java scrip t
cou ntry
Inve rse do m a ins
do m a in ge ne ric
do m a ins
Generic domains It defines registered host
according to their generic behaviour.
Eg :- • .com - commercial organisations
• .edu - educational institutes
• .gov - government institutes
Country domains - The country domains uses two
- character country abbreviations e.g. - US for United
States or Ca.us for California, United States.
Inverse domains - It is to map an address to a
name.
Resolution
Mapping a name to an address or an address to a
name is called resolution.
Resolver – DNS is designed as a client/server
application. A host that needs to map address to a name
or name to an address is called a resolver.
Mapping names to addresses – if the domain
name is from generic domain, the resolver receives a
query & it sends the query to local DNS for resolution.
Mapping Address to names - A client can send IP
address to a server to be mapped to a domain name.
This is called PTR query.
The IP address is reversed and two labels in-addr
and orpa are appended. The domain name is then
received by local DNS and resolved.
(a) Recursive resolution - The client
(resolver) can ask for a recursive answer i.e. it
expects the server to supply the final answer.
(b) Iterative resolution - In this if the server is
authority for the name it sends the answer
otherwise it sends the IP address of free server
it thinks can resolve the query.
So, it uses 4 types of servers
Root name server
Top level domain server
Authoritative server
Local DNS server
Information about computer and services are stored
in these servers in the terms of resource records.
Each resource records consists of 5 attributes.
Name
TTL
Class
Type
Value
ne arest R o ot S e rver
ro uter (h old in g top
ISP RJ le vel D N S )
ISP
w w w. xyz. co m
U se r Lo cal D N S 10 . 1 . 1 . 1.
server state in th is
router Top leve l
T LD
do m ain
S t ra i IP ss
C ont ght Aw ay AS P ad
d re
r o ls w
it h it get I
A utho ritative
S erve r • C om
(each D N S • go v
store s it)
S en de r R e ceive r
m a il m a il
server server
N o n A SC II N o n A SC II
M IM E M IM E
7 b it N V T A S C II 7 b it N V T A S C II
7 b it N V T A S C II
M TA M TA
M a il Interne t M a il
server server
SMTP uses port 25 at TLP. It is host to host
transport protocol.
It is a port of push mechanism i.e. it is used to push
the mail.
SMTP Uses commands & responses to
transfer messages between MTA client and
server.
The various commands include —
HELLO, MAIL FROM, RCPTTO, DATA QUIT,
HELP etc.
The various responses include —
System status, Start mail input, Service not
available.
Message Access Agent : POP AND IMAP
SMTP is just a push protocol i.e. it push the
message from server to client. However, the client must
pull messages from server
For this two protocols POP and IMAP are used.
S en de r
S M TP S M TP P O P 3/
IM A P
R e ceive r
M a il Interne t M a il
server server
6. NETWORK SECURITY
Integ rity
M e ssa ge
A uthe ntica tio n
N o n re pu dia tion
S ecurity S ervices
RSA
D i ffie H e llm a n
Trad ition al S im ple M od ern M o de rn
C ip he rs C ip he rs
E K (P ) = C D K (C ) = P
K Key
C Ciphertext
P Plain text
Symmetric Key Cryptography
In symmetric key cryptography both sender and
receiver use the same key for encryption and
decryption.
The general idea behind symmetric key
cryptography is,
S en de r
P P
C C
C h an ne l
E ncryp tion C = E K (P ) D e cryptio n P = D K (C )
(A) T A X E R T Z E N Z (B) Z Z T A X
ENERT
(C) Z T E X R T Z E N (D) R Z T T E
NAZXE
Sol. (D)
1 2 3 4 5
E X T R A
N E T Z Z
given in ques as bogus character
4 3 1 5 2
R T E A X
Z T N Z E
RZTTENAZXE
Correct Option is (D)
At receiver
3 5 1 4 2
1 1 1 0 0 C ip her te xt
Modern Cipher
1. Data Encryption Standard (DES)
64 -b it p la intext
Initia l pe rm u ta tion
K1
R oun d 1
64 bit
R o un d-ke y g en erator
K2 (8 -bit p arity cod e)
R o un d 2
64 bit 56 bit ciph er ke y
K 16
R o un d 16
64 bit
F in al p erm u tatio n
So in DES
1. Stages in DES 18
2. Rounds in DES 16
3. Plaintext and ciphertext length 64 bit
4. Round key generation use same method only
key changes (56)
3-DES
This is an extension of DES method which applies
DES cipher algorithm three times to each data block.
Encryption : Cipher text = EK3 (DK2 (EK1 (P) ) )
Decryption : Plain text = DK1 (EK2 (DK3 (C) ) )
Keying Option
1. All keys are dependent
3 × 56 = 168 independent Keys bits
2. K1 & K2 independent K1 = K3
2 × 56 = 112 Key bits
3. K1 = K2 = K3
56 bit key equivalent to DES
AES (Advance Encryption Standard Method)
P = D K2 (C )
At sender side
K1 = Public key of receiver
At receiver side
K2 = Private key of receiver
RSA Rivest Shamir Adleman
The various steps are –
1. p, q are large prime number, n = p × q
2. = (p – 1) (q – 1)
e public key of Receiver
d public key of Receiver
3. e × d mod = 1
4. Cipher text = Pe mod n
P plain text
5. Plain text P = Cd mod n
Ex. Let plaintext P be 5
P=3
q = 11
d=7
Find the cipher text
Sol. (1) n = p × q
= 3 × 11
n = 33
(2) = (p – 1) (q – 1)
= (2) (10)
p = 20
(3) (e × d) mod 20 = 1
(e × 7) mod 20 = 1
e3
(4) C = Pe mod n
C = 53 mod 33
C = 26
Diffie Hellman Cipher : It is used to resolve the
problem of symmetric key cryptography i.e. how to share
a private key between sender and receiver.
Let p and g be public keys
Sender Receiver
x y
R 1 = g m od p R 2 = g m od p
R1 R2
K = (R 2 ) x m od p K = (R 1) y m od p
So, k g modp
Comparison between symmetric & Asymmetric key
Cryptography
Assymmetric Symmetric
Cryptography Cryptography
Use two independent keys It uses only one key
public & private key. It uses i.e. private key
one to encrypt & other to
decrypt
It is slower. So, not used It is faster & used for
for long messages long messages
It is less secure than
It is much more secure
assymmetric
Total no. of keys n(n–
Total No. of keys 2n
1)/2
Public and Private Key Algorithm
Private and public key are part of encryption that
encodes the information.
Public Keys :
Public key uses asymmetric algorithm that converts
messages into unreadable format. A person who has a
public key can encrypt the message intended for a
specific receiver. The receiver with the private key can
only decode the message which is encrypted by the
public key. The key is available via the public accessible
directory.
Private Keys :
The private key is a secret key that is used to
decrypt the message and the party knows it that
exchange message. In traditional method, a secret key
is shared within communicators to enable encryption
and decryption the message, but if the key is lost, then
system becomes void. To avoid this weakness, PKI
(Public key infrastructure) came into force where a
public key is used along with the private key. PKI
enables internet users to exchange information in a
secure way with the use of public and private key.
P ub lic K e y P rivate K ey
Digital Signature :
Uses pair of asymmetric keys. Like
conventional signature, digital signature prove
the authenticity of sender as the sender of
message. (Non - repudiation) sender cannot
later deny that the message is generated by
him.
Comparison between digital & conventional
signature
Digital Signature Conventional S ignature
Method
R e ceive r
S en de r
S en de r's S en de r's
private pu blic
key key
sig ne d do cum e nt
P en cryp tio n de cryp tio n P
sig nin g verifying
algo rithm
T hrea ts to
in te grity
Firewalls
A firewall is a device (usually a router or computer)
installed between the internal network of an organisation
and rest of internet.
Interne t
F ire w a ll