computer networks notes
computer networks notes
Advantages:
Allows for easy communication between personal devices in close proximity.
Can be set up easily and quickly.
Uses wireless technology, which eliminates the need for wires and cables.
Disadvantages:
Limited coverage area.
May not be suitable for large-scale data transfer
LAN or Local Area Network connects network devices in such a way that personal computers
and workstations can share data, tools, and programs. The group of computers and devices are
connected together by a switch, or stack of switches, using a private addressing scheme as
defined by the TCP/IP protocol. Private addresses are unique in relation to other computers on
the local network. Routers are found at the boundary of a LAN, connecting them to the larger
WAN.
Advantages:
Provides fast data transfer rates and high-speed communication.
Easy to set up and manage.
Can be used to share peripheral devices such as printers and scanners.
Provides increased security and fault tolerance compared to WANs.
Disadvantages:
Limited geographical coverage.
Limited scalability and may require significant infrastructure upgrades to accommodate
growth.
May experience congestion and network performance issues with increased usage.
MAN or Metropolitan area Network covers a larger area than that covered by a LAN and a smaller
area as compared to WAN. MAN has a range of 5-50km. It connects two or more computers that
are apart but reside in the same or different cities. It covers a large geographical area and may serve
as an ISP (Internet Service Provider). MAN is designed for customers who need high-speed
connectivity. Speeds of MAN range in terms of Mbps. It’s hard to design and maintain a Metropolitan
Area Network.
Advantages:
Provides high-speed connectivity over a larger geographical area than LAN.
Can be used as an ISP for multiple customers.
Offers higher data transfer rates than WAN in some cases.
Disadvantages:
Can be expensive to set up and maintain.
May experience congestion and network performance issues with increased usage.
May have limited fault tolerance and security compared to LANs.
WAN or Wide Area Network is a computer network that extends over a large geographical area,
although it might be confined within the bounds of a state or country. WAN has a range of above
50 km. A WAN could be a connection of LAN connecting to other LANs via telephone lines and
radio waves. The technology is high-speed and relatively expensive.
Advantages:
Covers large geographical areas and can connect remote locations.
Provides connectivity to the internet.
Disadvantages:
Can be expensive to set up and maintain.
Offers slower data transfer rates than LAN or MAN.
OSI MODEL
The OSI model, created in 1984 by ISO, is a reference framework that explains the process of
transmitting data between computers. The OSI model consists of seven abstraction layers arranged
in a top-down order:
1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
Physical Layer – Layer 1
The lowest layer of the OSI reference model is the physical layer. It is responsible for the actual
physical connection between the devices. The physical layer contains information in the form
of bits. It is responsible for transmitting individual bits from one node to the next. When receiving
data, this layer will get the signal received and convert it into 0s and 1s and send them to the Data
Link layer, which will put the frame back together.
Note:
1. Packet in the Data Link layer is referred to as Frame.
2. Data Link layer is handled by the NIC (Network Interface Card) and device drivers of
host machines.
3. Switch & Bridge are Data Link Layer devices.
Note:
1. All the below 3 layers(including Session Layer) are integrated as a single layer in
the TCP/IP model as the “Application Layer”.
Presentation Layer – Layer 6
The presentation layer is also called the Translation layer. The data from the application layer is
extracted here and manipulated as per the required format to transmit over the network.
Functions of the Presentation Layer
Translation: For example, ASCII to EBCDIC.
Encryption/ Decryption: Data encryption translates the data into another form or
code. The encrypted data is known as the ciphertext and the decrypted data is known
as plain text.
Compression: Reduces the number of bits that need to be transmitted on the network.
Application Layer – Layer 7
At the very top of the OSI Reference Model stack of layers, we find the
Application layer which is implemented by the network applications.
These applications produce the data to be transferred over the network.
This layer also serves as a window for the application services
Note: 1. The application Layer is also called Desktop Layer.
2. Device or Protocol Use : SMTP
Functions of the Application Layer
The main functions of the application layer are given below.
Network Virtual Terminal(NVT): It allows a user to log on to a
remote host.
File transfer access and management(FTAM): This application
allows a user to
access files in a remote host, retrieve files in a remote host,
Mail Services: Provide email service.
Directory Services: This application provides distributed
database sources.
Advantages of OSI Model
It divides network communication into 7 layers which makes it
easier to understand and troubleshoot.
It standardizes network communications, as each layer has fixed
functions and protocols.
Diagnosing network problems is easier with the OSI model.
It is easier to improve with advancements as each layer can get
updates separately.
Differences between OSI Model and TCP/IP Model
Note: The OSI model acts as a reference model and is not implemented on
the Internet because of its late invention. The current model being used is
the TCP/IP model.
TCP/IP MODEL
TCP/IP was designed and developed by the Department of Defense (DoD) in the 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 the seven layers in the
OSI model.
TRANSMISSION MEDIA
a transmission medium is a physical path between the transmitter and the receiver i.e. it is the
channel through which data is sent from one place to another. Transmission Media is broadly
classified into the following types:
1. Guided Media: It is also referred to as Wired or Bounded transmission media. Signals being
transmitted are directed and confined in a narrow pathway by using physical links.
Features:
High Speed
Secure
Used for comparatively shorter distances
There are 3 major types of Guided Media:
⇢ Easy to install
⇢ High-speed capacity
Disadvantages:
⇢ Susceptible to external interference
Applications:
Used in telephone connections and LAN networks
⇢ Eliminates crosstalk
⇢ Comparatively faster
Disadvantages:
⇢ Comparatively difficult to install and manufacture
⇢ More expensive
⇢ Bulky
Advantages:
High Bandwidth
Better noise Immunity
Easy to install and expand
Inexpensive
Disadvantages:
Single cable failure can disrupt the entire network
(iii) Optical Fiber Cable –
It uses the concept of refraction of light through a core made up of glass or plastic. The core is
surrounded by a less dense glass or plastic covering called the cladding. It is used for the
transmission of large volumes of data.
The cable can be unidirectional or bidirectional. The WDM (Wavelength Division Multiplexer)
supports two modes, namely unidirectional and bidirectional mode.
Advantages:
Increased capacity and bandwidth
Lightweight
Resistance to corrosive materials
Disadvantages:
Difficult to install and maintain
High cost
Fragile
2. Unguided Media:
It is also referred to as Wireless or Unbounded transmission media. No physical medium is
required for the transmission of electromagnetic signals.
Features:
The signal is broadcasted through air
Less Secure
Used for larger distances
There are 3 types of Signals transmitted through unguided media:
(ii) Microwaves –
It is a line of sight transmission i.e. the sending and receiving antennas need to be properly aligned
with each other. The distance covered by the signal is directly proportional to the height of the
antenna. Frequency Range:1GHz – 300GHz. These are majorly used for mobile phone
communication and television distribution.
(iii) Infrared –
Infrared waves are used for very short distance communication. They cannot penetrate
through obstacles. This prevents interference between systems. Frequency Range:300GHz
– 400THz. It is used in TV remotes, wireless mouse, keyboard, printer, etc.
SWITCHING
In computer networking, Switching is the process of transferring data packets from one device to
another in a network, or from one network to another, using specific devices called switches.
Switching takes place at the Data Link layer of the OSI Model
Types of Switching
There are three types of switching methods:
Message Switching
Circuit Switching
Packet Switching
Datagram Packet Switching
Virtual Circuit Packet Switching
Message Switching: This is an older switching technique that has become obsolete. In
message switching technique, the entire data block/message is forwarded across the
entire network thus, making it highly inefficient.
Circuit Switching: In this type of switching, a connection is established between the
source and destination beforehand. This connection receives the complete bandwidth of
the network until the data is transferred completely.
This approach is better than message switching as it does not involve sending data to the
entire network, instead of its destination only.
Packet Switching: This technique requires the data to be broken down into smaller
components, data frames, or packets. These data frames are then transferred to their
destinations according to the available resources in the network at a particular time.
This switching type is used in modern computers and even the Internet.
Datagram Packet Switching: In Datagram Packet switching, each data frame is taken as an
individual entity and thus, they are processed separately.
What is Multiplexing?
Multiplexing is the sharing of a medium or bandwidth. It is the process in which multiple signals
coming from multiple sources are combined and transmitted over a single communication/physical
line.
1. Frequency Division Multiplexing :
Frequency division multiplexing is defined as a type of multiplexing where the bandwidth of a
single physical medium is divided into a number of smaller, independent frequency channels.
UNIT 2
Media Access Control (MAC): It defines the specific access method for each LAN, Ethernet and Take
care of Addressing at the level (Lan technology).
-Flow control, error control, and part of the framing du es are collected into one sublayer called the
logical link control (LLC).
- Framing is handled in both the LLC sublayer and the MAC sublayer.
What is Go-Back-N ARQ?
In Go-Back-N ARQ, N is the sender's window size. Suppose we say that Go-Back-3, which means that
the three frames can be sent at a time before expecting the acknowledgment from the receiver.
If we have five frames and the concept is Go-Back-3, which means that the three frames can be sent,
i.e., frame no 1, frame no 2, frame no 3 can be sent before expecting the acknowledgment of frame no
1.
In Go-Back-N ARQ, the frames are numbered sequentially as Go-Back-N ARQ sends the multiple
frames at a time that requires the numbering approach to distinguish the frame from another frame,
and these numbers are known as the sequential numbers.
The number of frames that can be sent at a time totally depends on the size of the sender's window. If
the acknowledgment of a frame is not received within an agreed-upon time period, then all the
frames available in the current window will be retransmitted. Suppose we have sent the frame no 5,
but we didn't receive the acknowledgment of frame no 5, and the current window is holding three
frames, then these three frames will be retransmitted.
Here stop and wait means, whatever the data that sender wants to send, he sends the data to the
receiver. After sending the data, he stops and waits until he receives the acknowledgment from the
receiver. The stop and wait protocol is a flow control protocol where flow control is one of the services
of the data link layer.
It is a data-link layer protocol which is used for transmitting the data over the noiseless channels. It
provides unidirectional data transmission which means that either sending or receiving of data will take
place at a time. It provides flow-control mechanism but does not provide any error control mechanism.
The idea behind the usage of this frame is that when the sender sends the frame then he waits for the
acknowledgment before sending the next frame.
Sender side
Rule 2: Sender sends the next packet only when it receives the acknowledgment of the previous packet.
Receiver side
Rule 2: When the data packet is consumed, receiver sends the acknowledgment to the sender.
Disadvantages of Stop and Wait protocol
The following are the problems associated with a stop and wait protocol:
Selective Repeat Protocol (SRP) : This protocol(SRP) is mostly identical to GBN protocol, except
that buffers are used and the receiver, and the sender, each maintains a window of equal size. SRP
also requires full-duplex link.
1. Random Access Protocol: In this, all stations have same superiority that is no station has more
priority than another station. Any station can send data depending on medium’s state( idle or
busy). It has two features:
1. There is no fixed time for sending data
2. There is no fixed sequence of stations sending data
The Random access protocols are further subdivided as:
(a) ALOHA – It was designed for wireless LAN but is also applicable for shared medium. In this,
multiple stations can transmit data at the same time and can hence lead to collision and data
being garbled.
Pure Aloha:
When a station sends data it waits for an acknowledgement. If the acknowledgement
doesn’t come within the allotted time then the station waits for a random amount of
time called back-off time (Tb) and re-sends the data. Since different stations wait for
different amount of time, the probability of further collision decreases.
Vulnerable Time = 2* Frame transmission time
Throughput = G exp{-2*G}
Maximum throughput = 0.184 for G=0.5
Slotted Aloha:
It is similar to pure aloha, except that we divide time into slots and sending of data is
allowed only at the beginning of these slots. If a station misses out the allowed time, it
must wait for the next slot. This reduces the probability of collision.
Vulnerable Time = Frame transmission time
Throughput = G exp{-*G}
Maximum throughput = 0.368 for G=1
In this Aloha, any station can transmit In this, any station can transmit the data at the
the data at any time. beginning of any time slot.
In this, The time is continuous and not In this, The time is discrete and globally
globally synchronized. synchronized.
Vulnerable time for Pure Aloha = 2 x Tt Vulnerable time for Slotted Aloha = Tt
= 18.4% = 36.8%
Pure Aloha doesn’t reduce the number of Slotted Aloha reduces the number of collisions to
collisions to half. half and doubles the efficiency of Pure Aloha.
CSMA CD
The Carrier Sense Multiple Access/ Collision Detection protocol is used to detect a collision in the
media access control (MAC) layer. Once the collision was detected, the CSMA CD immediately stopped
the transmission by sending the signal so that the sender does not waste all the time to send the data
packet. Suppose a collision is detected from each station while broadcasting the packets. In that case,
the CSMA CD immediately sends a jam signal to stop transmission and waits for a random time context
before transmitting another data packet. If the channel is found free, it immediately sends the data and
returns it.
Advantages of CSMA CD:
1. It is used for collision detection on a shared channel within a very short time.
Disadvantage of CSMA CD
1. It is not suitable for long-distance networks because as the distance increases, CSMA CD'
efficiency decreases.
2. It can detect collision only up to 2500 meters, and beyond this range, it cannot detect collisions.
3. When multiple devices are added to a CSMA CD, collision detection performance is reduced.
CSMA/CA
CSMA stands for Carrier Sense Multiple Access with Collision Avoidance. It means that it is a network
protocol that uses to avoid a collision rather than allowing it to occur, and it does not deal with the
recovery of packets after a collision. It is similar to the CSMA CD protocol that operates in the media
access control layer. In CSMA CA, whenever a station sends a data frame to a channel, it checks whether
the channel is ideal or not. If the shared channel is busy, the station waits until the channel enters idle
mode. Hence, we can say that it reduces the chances of collisions and makes better use of the medium
to send data packets more efficiently.
Advantage of CSMA CA
1. When the size of data packets is large, the chances of collision in CSMA CA is less.
2. It controls the data packets and sends the data when the receiver wants to send them.
3. It is used to prevent collision rather than collision detection on the shared channel.
1. Sometime CSMA/CA takes much waiting time as usual to transmit the data packet.
CSMA/CD CSMA/CA
CSMA / CD resends the data frame Whereas CSMA / CA will first transmit
4.
whenever a conflict occurs. the intent to send for data transmission.
It is the type of CSMA to detect the It is the type of CSMA to avoid collision
7
collision on a shared channel. on a shared channel.
Vpn
VPN stands for Virtual Private Network. It allows you to connect your computer to a
private network, creating an encrypted connection that masks your IP address to securely
share data and surf the web, protecting your identity online.
Types of VPNs
Router VPN
Firewall VPN
An IP address is an address having information about how to reach a specific host, especially outside
the LAN. An IP address is a 32-bit unique address having an address space of 2 POWER32.
Generally, there are two notations in which the IP address is written, dotted decimal notation and
hexadecimal notation.
Classful Addressing
The 32-bit IP address is divided into five sub-classes. These are given below:
Class A
Class B
Class C
Class D
Class E
The IPv4 address is divided into two parts:
Network ID
Host ID
Class A
IP addresses belonging to class A are assigned to the networks that contain a large number of
hosts.
The network ID is 8 bits long.
The host ID is 24 bits long.
IP addresses belonging to class A ranges from 0.0.0.0 – 127.255.255.255.
Class B
IP address belonging to class B is assigned to networks that range from medium-sized to large-
sized networks.
The network ID is 16 bits long.
The host ID is 16 bits long.
IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.
Class C
IP addresses belonging to class C are assigned to small-sized networks.
The network ID is 24 bits long.
The host ID is 8 bits long.
IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.
Class D
IP address belonging to class D is reserved for multi-casting. The higher-order bits of the first octet
of IP addresses belonging to class D is always set to 1110
Class E
IP addresses belonging to class E are reserved for experimental and research purposes. IP
addresses of class E range from 240.0.0.0 – 255.255.255.254.
MAC
Address IP Address
MAC Address stands for Media Access IP Address stands for Internet
1.
Control Address. Protocol Address.
Ipv4 Ipv6
Fields IPv4 is a numeric address that IPv6 is an alphanumeric address that consists of 8 fields,
consists of 4 fields which are which are separated by colon.
separated by dot (.).
Classes IPv4 has 5 different classes of IP IPv6 does not contain classes of IP addresses.
address that includes Class A, Class B,
Class C, Class D, and Class E.
Number of IP IPv4 has a limited number of IP IPv6 has a large number of IP addresses.
address addresses.
Address It supports manual and DHCP It supports manual, DHCP, auto-configuration, and
configuration configuration. renumbering
Checksum field The checksum field is available in IPv4. The checksum field is not available in IPv6.
Classful
Parameter Classless Addressing
Addressing
Classless addressing
In Classful addressing IP came to replace the
addresses are allocated classful addressing and
1. Basics
according to the classes- to handle the issue of
A to E. rapid exhaustion of IP
addresses.
Classful addressing
It requires less
requires more bandwidth.
bandwidth. Thus, fast
As a result, it becomes
5. Bandwidth and less expensive as
slower and more
compared to classful
expensive as compared
addressing.
to classless addressing.
Regular or periodic
7. Updates Triggered Updates
updates
ClasslessInter-DomainRouting(CIDR):
CIDR or Class Inter-Domain Routing was introduced in 1993 to replace classful addressing.
CIDR notation:
In CIDR subnet masks are denoted by /X. For example a subnet of 255.255.255.0 would be
denoted by /24. To work a subnet mask in CIDR, we have to first convert each octet into its
respective binary value. For example, if the subnet is of 255.255.255.0. then :
First Octet –
255 has 8 binary 1's when converted to binary
Second Octet –
255 has 8 binary 1's when converted to binary
Third Octet –
255 has 8 binary 1's when converted to binary
Fourth Octet –
0 has 0 binary 1's when converted to binary
Therefore, in total there are 24 binary 1’s, so the subnet mask is /24.
Classful Classless
Addressing Addressing
Routing
o The rou ng protocol is a process where the router connects with other routers in order to share
informa on about the most cost-effec ve path and status of the network. The rou ng process selects
the best path on the basis of the reachability informa on and stores it in a router table.
o A Router works at the network layer in the OSI model and internet layer in TCP/IP model
Types of Routing
o Static Routing:
o Default Routing
o Dynamic Routing
Distant Vector Protocol
Distant vector protocol, also called as Bellman-Ford algorithm or Ford Fulkerson algorithm used to calculate a
path. A distance-vector protocol calculates the distance and direction of the vector of the next hop from the
information obtained by the neighboring router. It is necessary to keep track of the topology and inform
neighboring devices if any changes occur in topology.
Let's consider a scenario where all the routers are set and run the distant routing protocol. Each router in the
network will share the distance information with the neighboring router. All the information is gathered from the
neighbor routers. With each router information, an optimal distance is calculated and stored in the routing table.
This way, the process of calculating the optimal path is done using the distant vector routing protocol.
Link-State Routing
Link-State Routing protocols build a complete topology of the entire network and then calculate the best path
from the topology of all interconnected networks. In link-state routing, the distance is calculated based on
multiple metrics from source to destination, one hop at a time.
The link-state routing protocol maintains three different tables that are neighbor table, the topology table, and
the routing table. The neighbor table stores the information of the neighbor table. The topology table stores the
information on network topology, and the routing table keeps track of all the paths to the different networks. It
requires more memory and processing power as it has the complete picture of the network.
Discovering The Neighbour: When routes are boosted, the first task is to learn about the neighbors.
Routers send a hello message to neighbors.
Measuring Delay: According to the link-state rou ng protocol, each router must know or have a
reasonable es mate of the delay to each of its neighbors.
Construct packets and distribute them to routers Once the information is collected, the packets
containing all the data of neighbors are built. The packet has the identity of the sender, followed by a
sequence number and age, and a list of neighbors. After this, packets are forwarded to the network.
Computing new route. A router is used to compute the shortest distance to a destination.
Border Gateway
Protocol Routing Information Protocol
2. It initially came in the year 1989. It was defined in the year 1988.
Distance
Vector Routing Link State Routing
ARP RARP
Client broadcasts its IP address Client broadcasts its MAC address and
and requests a MAC address, requests an IP address,
The header of a TCP segment can range from 20-60 bytes. 40 bytes are for options. If there are no
options, a header is 20 bytes else it can be of upmost 60 bytes.
Header fields:
Sequence Number –
A 32-bit field that holds the sequence number.
Acknowledgement Number –
A 32-bit field that holds the acknowledgement number
Header Length (HLEN) –
This is a 4-bit field that indicates the length of the TCP header by a number of 4-byte
words in the header,
Control flags –
These are 6 1-bit control bits that control connection establishment, connection
termination, connection abortion, flow control, mode of transfer etc. Their function is:
URG: Urgent pointer is valid
ACK: Acknowledgement number is valid( used in case of cumulative
acknowledgement)
PSH: Request for push
RST: Reset the connection
SYN: Synchronize sequence numbers
FIN: Terminate the connection
Window size –
This field tells the window size of the sending TCP in bytes.
Checksum –
This field holds the checksum for error control. It is mandatory in TCP as opposed to
UDP.
What is Cryptography?
Cryptography is a technique of securing information and communications through the use of codes
so that only those persons for whom the information is intended can understand and process it.
Thus preventing unauthorized access to information. The prefix “crypt” means “hidden” and the
suffix “graphy” means “writing”. In Cryptography, the techniques that are used to protect
information are obtained from mathematical concepts and a set of rule-based calculations
Features Of Cryptography
Confidentiality: Information can only be accessed by the person for whom it is
intended and no other person except him can access it.
Integrity: Information cannot be modified in storage or transition between sender and
intended receiver
Authentication: The identities of the sender and receiver are confirmed. As well
destination/origin of the information is confirmed.
Adaptability: Cryptography continuously evolves to stay ahead of security threats
Types Of Cryptography
1. Symmetric Key Cryptography
It is an encryption system where the sender and receiver of a message use a single common key to
encrypt and decrypt messages. Symmetric Key cryptography is faster and simpler but the problem
is that the sender and receiver have to somehow exchange keys securely.
2. Hash Functions
There is no usage of any key in this algorithm. A hash value with a fixed length is calculated as per
the plain text
3. Asymmetric Key Cryptography
In Asymmetric Key Cryptography, a pair of keys is used to encrypt and decrypt information. A
receiver’s public key is used for encryption and a receiver’s private key is used for decryption. Public
keys and Private keys are different. Even if the public key is known by everyone the intended receiver
can only decode it because he alone knows his private key. The most popular asymmetric key
cryptography algorithm is the RSA algorithm.
TELNET
TELNET stands for Teletype Network. It is a type of protocol that enables one computer to connect
to the local computer. he computer which starts the connection is known as the local computer. The
computer which is being connected to i.e. which accepts the connection known as the remote
computer.
During telnet operation, whatever is being performed on the remote computer will be displayed by
the local computer. Telnet operates on a client/server principle.
o FTP is a standard internet protocol provided by TCP/IP used for transmitting the files from one
host to another.
o It is mainly used for transferring the web page files from their creator to the computer that acts
as a server for other computers on the internet.
o It is also used for downloading the files to computer from other servers.
Objectives of FTP
o Control Connection: The control connection uses very simple rules for communication.
o Data Connection: The Data Connection uses very complex rules as data types may vary.
WORLD WIDE WEB
World Wide Web, which is also known as a Web, is a collection of websites or web pages stored in
web servers and connected to local computers through the internet. These websites contain text
pages, digital images, audios, videos, etc. Users can access the content of these sites from any part of
the world over the internet using their devices such as computers, laptops, cell phones, etc. The
WWW, along with internet, enables the retrieval and display of text and media to your device.
What is DDNS?
The Dynamic Domain Name System (DDNS) is a protocol that provides DNS
extensions that allow DNS servers to accept requests to dynamically add,
update, and delete entries in the DNS database.