0% found this document useful (0 votes)
18 views14 pages

Short Notes Computer Networks 64

The document provides an overview of computer networks, including subnet masks, IP addressing classes, private address ranges, and the OSI model layers with their functions. It discusses network topologies, transmission modes, delays, throughput, efficiency, flow control, error control, and routing protocols. Additionally, it covers TCP mechanisms, congestion control, and switching types, along with formulas for calculating various network parameters.

Uploaded by

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

Short Notes Computer Networks 64

The document provides an overview of computer networks, including subnet masks, IP addressing classes, private address ranges, and the OSI model layers with their functions. It discusses network topologies, transmission modes, delays, throughput, efficiency, flow control, error control, and routing protocols. Additionally, it covers TCP mechanisms, congestion control, and switching types, along with formulas for calculating various network parameters.

Uploaded by

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

byjusexamprep.

com

1
byjusexamprep.com

Short Notes — COMPUTER NETWORKS

• Default subnet Mask:

Class A: 255.0.0.0

Class B: 255.255.0.0

Class C: 255.255.255.0

• IP Addressing

Class A → 0 → (1 - 126), No. of IP Addresses = 231

Class B → 10 → (128 - 191), No. of IP Addresses = 230

Class C → 110 → (192 - 223), No. of IP Addresses = 229

Class D → 1110 → (224 - 239), No. of IP Addresses = 228

Class E → 1111 → (240 - 255), No. of IP Addresses = 228

• Private Addresses Range:

10.0.0.0 to 10.255.255.255 — 1 class A Network

172.16.0.0 to 172.31.255.255 → 16 class B Network

192.168.0.0 to 192.168.255.255 → 256 class C Network

CLASS NUMBER OF NETWORKS NUMBER OF HOSTS

Class A 27 -2=126 224 -2 = 1,67,77,214 hosts

Class B 214 =16384 216 -2 = 65,534 hosts

Class C 221 =20,97,125 28 -2 = 254 hosts

Class D No NID and HID, all 28 remaining bits are used to define the multicast address.

Class E No NID and HID, it is meant for research and future purpose.

2
byjusexamprep.com

Layers Data Units Functions

Application Layer Data Mail Services, Directory Services, FTAM

Presentation Layer Data Encryption/Decryption, Compression

Session Establishment, Synchronization, Dialog


Session Layer Data
Controller

Transport Layer Segments, Datagram Segmentation

Network Layer Packets Traffic control, Fragmentation, Routing

Data Link Layer Frames Flow control, Error control, Access control

Bit Synchronization, Bit rate control, Physical


Physical Layer Bits
Topologies

OSI Model DoD Model Protocols Devices / Apps

DNS, DHCP, NTP, SNMP, HTTPS,


Web server, Mail server,
Layer 5,6,7 Application FTP, SSH, TELNET, HTTP,
Browser, Mail client ...etc.
POP3...etc.

Layer 4 Host to Host TCP | IDP Gateway

Router, Firewall layer 3,


Layer 3 Internet IP, ICMP, IGMP
Switch

Layer 2 Network ARP (MAC), RARP' Bridge, Layer 2 switch

Layer 1 access Ethernet, Token ring Hub

NID HID

1. – 0’s → Network ID

2. – 1’s → DBA

3. 1’s 1’s → LBA

4. 0’s – → Host with in the Network

5. 1’s 0’s → Network Mask or Subnet Mask

3
byjusexamprep.com

• CIDR RULES
1. All the IP Addresses in the Block must be contiguous.
2. Block size must be a power of 2.
3. First IP address of the block must be divisible by the size of the block.

• NETWORK TOPOLOGIES
There are four types of network topologies:-
1. Bus Topology
2. Ring Topology
3. Star Topology
4. Mesh Topology

• TRANSMISSION MODES
There are three types of transmission modes: -
1. Simplex Mode
2. Half-Duplex Mode
3. Full-Duplex Mode

• DELAYS IN COMPUTER NETWORKS


There are four different kinds of delay that occur during the transmission:
1. Transmission delay
2. Propagation delay
3. Queuing delay
4. Processing delay

• TRANSMISSION DELAY (T d) –
Length / Size of data packet
Transmission delay =
Bandwidth of Network

• PROPAGATION DELAY (P d) –
Distance between sender and receiver
Propagation delay =
Transmission speed

• QUEUING DELAY –
The time spent by the data packet waiting in the queue before it is taken for the execution is
called the queuing delay.

4
byjusexamprep.com

• PROCESSING DELAY –
The time taken by the processor to process the data packet is called the processing delay.

• TOTAL DELAY –
The total delay in sending one data packet or End to End time =
Transmission delay + Propagation delay + Queuing delay + Processing delay

• THROUGHPUT
Throughput = Efficiency × Bandwidth
Tt
Throughput =  Bandwidth
Tt + 2xTp
L/B
Throughput = B
Tt + 2xd / v
L
Throughput =
2xd / v

• EFFICIENCY

(Transmission delay) packet


Efficiency (η) =
(Transmission delay) packet + 2 x Propagation delay
OR
Tt
Efficiency (η)=
Tt + 2 Tp
OR
1
Efficiency (η) =
T 
1+ 2 p 
 Tt 
OR

1  Tp 
Efficiency ( ) = , where a =  
1 + 2a  Tt 

• FLOW CONTROL
1. Propagation Delay (P d) = Distance/Velocity or d/v
2. Transmission Delay (Td ) = Length of packet / Bandwidth or L/B
3. RTT =Td(data) +2*Pd +Td(Ack) +Prd +Qd

• Optimal window size = 1 + 2a


• Minimum seq. No required = 1 + 2a
• Min no. of bits required = ⌈log 2 (1 + 2a)⌉ in the sequence No. field.

5
byjusexamprep.com

N = Sender’s Window Size. (in SR, both sender and receiver window are the same)
a = T p /Tt
1. Sequence No. >= (Sender’s Window Size) + (Receiver’s Window Size )
2. Efficiency in TDM (polling) = Tt / (Tpoll + T t)
3. In CSMA/CD, Tt >= 2*T p
4. Hence, minimum frame length = 2*Tp*B
5. In CSMA/CD, Efficiency = 1/(1 + 6.44a)

• MAXIMUM DATA RATE(CHANNEL CAPACITY) FOR NOISELESS AND NOISY CHANNELS


o Noiseless Channel: Nyquist Bit Rate
o Bit Rate = 2 * Bandwidth * log2(L)
o where L is the number of signal levels used to represent data.
o Noisy Channel: Shannon Capacity
o Capacity = bandwidth * log2(1 + SNR)
o where SNR is the signal-to-noise ratio

Stop & wait GBN SR

η = 1/1+2a η = WS/1+2a
η = N/1+2a
or
or
or
n =
n=
useful time/ Total n =
useful time/ Total time
time useful time/ Total time
Efficiency
or
or or
η = WS ∗ Td/RTT
η = T d/RTT η = N∗Td/RTT

Length of data Pkt/RTT N ∗ Length of data Pkt/RTT WS ∗ Length of data Pkt/RTT

or Or Or
Throughput
η*B η*B η*B

Buffer 1+1 N+1 N+N

Seq No. 2 N+1 2N

Sequence No. WS /2K – 1


WS /2K−1 WR /2K−1
= K bit WR/1

6
byjusexamprep.com

• BACKOFF ALGORITHM FOR CSMA/CD


1. Waiting time = back–off time
Let n = collision number or re-transmission serial number.
Then, Waiting time = K * Tslot
where K = [0, 2n – 1 ]
2. N = No. of stations
Early Token Reinsertion : Efficiency = 1/(1 + a/N)
Delayed Token Reinsertion : Efficiency = 1/(1 + (N+1)a/N)
3. Pure Aloha Efficiency = 18.4 %
Slotted Aloha Efficiency = 36.8%

• Steps to Calculate SWP Problem:


1. Calculate RTT
2. Based on the given Bandwidth and RTT calculate No. of bits we are able to transfer within RTT
and Equate it as a window in terms of bits (Wbits)=B*RTT
3. Wpkt or Wp = Wbits /Packet Size(bits)

4. Minimum sequence No. required = Wp


5. 2K = WP
Where K= number of bits required in the sequence number

• ERROR CONTROL
1. To detect ‘d’ bit error minimum Hamming distance required = d +1
2. To correct ‘d’ bit error minimum Hamming distance required = 2d + 1
3. In Hamming code No. of redundant bit or check bits or Parity bits:
r=(m+r+1) <= 2r (lower limit)

• CRC
1. If the generator has more than one term and the coefficient of x° is 1, all single-bit errors can
be detected.
2. If a generator cannot divide x t+2 (t between 0 and n-1), then all isolated double errors can be
detected.
3. A generator that contains a factor of x+1 and detects all odd-numbered errors.
A good polynomial generator needs to have the following characteristics: -
1. It should have at least two terms.
2. The coefficient of the term x° should be 1.
3. It should not divide xt+1 for t between 2 and n-1.
4. It should have the factor x+1.

7
byjusexamprep.com

• ACCESS CONTROL
1. Minimum size of the frame to detect the collision in Ethernet (CSMA/CD)
Td >= 2* Pd + Td(Jam signal)

2. Backoff Algorithm
Waiting time = K * Slot duration
= K * RTT
= K * 2 * Pd
Range of K = 0 to 2n-1, where n is the collision number

3. Efficiency in Ethernet (CSMA/CD)


η = 1/1+6.44a or η = Useful time / Total time
= Td / (Collision time + T d + Pd)

4. P(1-P)N-1 = Probability of success for single station


N(1-P)N-1 = Probability of success for any station among all station
[Throughput of the channel]

5. Ethernet [Packet Size]


Min Size Max size
46 1500 [Data]
64 1518 [Frame]

• NETWORK LAY

First
Address First octet bits (red Network (N) and Default
octet
Class bits don't change) Host (H) portion Subnet Mask
(Decimal)

A 1-127 00000000-01111111 N.H.H.H 255.0.0.0

B 128-191 10000000-10111111 N.N.H.H 255.255.0.0

C 192-223 11000000-11011111 N.N.N.H 255.255.255.0

D 224-239 11100000-11101111 n/a (multicast)

E 240-255 11111111-11111111 n/a (experimental)

8
byjusexamprep.com

• DISTANCE VECTOR ROUTING VS LINK STATE ROUTING

Distance Vector Routing (DVR) Link State Routing (LSR)

Sends the entire table Sends only link state information

Slow convergence Fast convergence

Susceptible to routing loops Less susceptible to routing loops

Updates are sometimes sent using


Always uses multicast for the routing updates
broadcast

Doesn't know the network topology Knows the entire network topology

Simpler to configure Can be harder to configure

Examples: RIP, IGRP Examples: OSPF, IS-IS

• TCP 3-WAY HANDSHAKE PROCESS


o STEP 1: SYN
o STEP 2: SYN + ACK
o STEP 3: ACK

• TCP HEADER

Part No. Name

0-1023 Well known port No.

1024-49151 Registered Port No.

49152-65535 Dynamic

9
byjusexamprep.com
SYN = 1 → 1 Seq Number
ACK = 1 → 0 Seq Number
FIN = 1 → 1 Seq Number
1 Data byte → 1 Seq Number

SYN Ack Meaning

1 0 request

1 1 reply

0 1 Ack

0 0 Data

o Wrap Around Time (WAT) = Total sequence Number / Bandwidth


(Bandwidth in byte/sec)
o Min sequence number required to avoid wrap around time with in Life time
= B* LT
o Min number of bits required to avoid wrap around time with in LT
= = ⌈log 2 B * LT⌉

• TIME OUT TIMER IN TCP

Basic Algorithm Jacobson’s Algorithm

TO = 2 * RTT TO = 4 * ID + RTT
NRTT = α(IRTT) + (1 –α ) ARTT NRTT =α (IRTT) + (1 – α) ARTT
0 ≤ α≤ 1 0 ≤ α≤ 1
AD = |IRTT - ARTT|
ND =α (ID) + (1 –α )AD

• CONGESTION CONTROL
Slow start Congestion Avoidance Congestion Detection

1. If Ack Arrives Wc 1. IF Ack Arrives 1. Time out


= Wc + 1 Wc = Wc + 1/Wc

2. After one RTT 2. After one RTT Wc 2. 3 duplicate Ack


Wc = 2 * WC = Wc + 1

10
byjusexamprep.com

• TOKEN BUCKET
Maximum Avg rate for Token Bucket (m) = (c+rt)/t
m/1 = (c+rt)/t
mt = c+rt,
mt – rt = c
(m-r)t = c
t = c/(m-r)

c → Token Bucket Capacity


r → Token Arrival Rate

• SWITCHING
Switching are basically classified into two categories: -
1. Circuit Switching
2. Packet Switching

o CIRCUIT SWITCHING:
Total time = Setup Time(S) + T d + Pd + Tear Down Time (T)
TT = S + L/B + X.d/v + T

o PACKET SWITCHING:
X → Hop
N → Packet
Total time = X[T d + Pd ] + X-1 [P d + Qd] + N-1[T d]

Application Port No Transport Protocol

DNS 53 UDP

HTTP 80 TCP
20 (Data connection)
FTP 21 (Control connection) TCP
SMTP 25 TCP

POP 110 TCP

SNMP 161, 162 UDP

TFTP 69 UDP

IMAP 143 TCP

Telnet 23 TCP

11
byjusexamprep.com

SHORT TRICK DNS HTTP SMTP POP IMAP FTP

Stateful/
Stateless Stateless Stateless Stateful Stateful Stateful
Stateless

Transport
UDP TCP TCP TCP TCP TCP
Protocol Used

Connectionless/
Connection Connection Connection Connection Connection Connection
Connection
Less less oriented oriented oriented oriented
Oriented

The control
HTTP 1.0 is
connection is
non
persistent.
Non- persistent
Persistent/Non- Data
persistent HTTP 1.1
persistent Persistent Persistent Persistent connection is
is
non-
persistent.
persistent.

Push/Pull - - Push Pull Pull Can’t


20 for data
connection.
Port Number Used 53 80 25 110 143 21 for the
control
connection.
-band
In-band/ In
In In-band In-band Out-of-band
Out-of-band -band
In-band

• IPv4

12
byjusexamprep.com

• IPv6

• UDP HEADER

• DIFFERENCE BETWEEN TCP AND UDP

TCP UDP

Keeps track of lost packets. Makes sure that lost packets are Doesn't keep track of lost
re-sent packets

Adds sequence numbers to packets and reorders any Doesn't care about packet
packets that arrive in the wrong order arrival order

Faster, because it lacks any


Slower, because of all added additional functionality
extra features

Requires more computer resources, because the OS needs


Requires less computer
to keep track of ongoing communication sessions and
resources
manage them on a much deeper level

Examples of programs and services that use TCP: Examples of programs and
- HTTP services that use
- HTTPS - UDP:
- FTP - DNS
- Many computer games - IP telephony

13
byjusexamprep.com

• APPLICATION LAYER

Service Type Direction.

DNS UDP Out

HTTP/HTTPS TCP Out

FTP TCP/UDP Out

TELNET TCP/UDP Out

POP3 TCP Out

SMTP TCP Out

IRCU TCP/UDP Out

IDENT TCP In

Private File Service TCP/UDP In/Out

NNTP TCP/UDP Out

NTP TCP/UDP Out

Remote Desktop TCP/UDP In/Out

Transport
Application Type Application-layer protocol
Protocol

Send: Simple Mail Transfer Protocol


TCP 25
SMTP [RFC 821]
Electronic mail
Receive: Post Office Protocol v3 POP3 [RCF
TCP 110
1939]

Remote terminal access Telnet [RFC 854] TCP 23

World Wide Web Hypertext Transfer Protocol 1.1


TCP 80
(WWW) HTTP 1.1 [RFC 2068]

File Transfer Protocol


TCP 21
FTP [RFC 959]
File Transfer
Trivial File Transfer Protocol
UDP 69
TFTP [RFC 1350]

Remote file server NFS [McKusik 1996] UDP or TCP

Streaming multimedia Proprietary (e.g., Real Networks) UDP or TCP

Internet telephony Proprietary (e.g., Vocaltec) Usually, UDP

****

14

You might also like