Network and System Unit 4 Notes
Network and System Unit 4 Notes
Network and System Unit 4 Notes
Transport Layer:
Introduction to TCP/UDP protocols. (C1: Knowledge)
Distinguish World Wide Web (WWW), Domain Name System (DNS), E-mail, File
Transfer Protocol (FTP), HTTP as an application layer protocol (C4: Analysis)
Transport Layer:
o Source port address: It defines the address of the application process that has
delivered a message. The source port address is of 16 bits address.
o Destination port address: It defines the address of the application process that
will receive the message. The destination port address is of a 16-bit address.
o Total length: It defines the total length of the user datagram in bytes. It is a 16-
bit field.
o Checksum: The checksum is a 16-bit field which is used in error detection.
TCP
o TCP stands for Transmission Control Protocol.
o It provides full transport layer services to applications.
o It is a connection-oriented protocol means the connection established between
both the ends of the transmission. For creating the connection, TCP generates a
virtual circuit between sender and receiver for the duration of a transmission.
o Stream data transfer: TCP protocol transfers the data in the form of contiguous
stream of bytes. TCP group the bytes in the form of TCP segments and then
passed it to the IP layer for transmission to the destination. TCP itself segments
the data and forward to the IP.
o Reliability: TCP assigns a sequence number to each byte transmitted and expects
a positive acknowledgement from the receiving TCP. If ACK is not received within
a timeout interval, then the data is retransmitted to the destination.
The receiving TCP uses the sequence number to reassemble the segments if they
arrive out of order or to eliminate the duplicate segments.
o Flow Control: When receiving TCP sends an acknowledgement back to the
sender indicating the number the bytes it can receive without overflowing its
internal buffer. The number of bytes is sent in ACK in the form of the highest
sequence number that it can receive without any problem. This mechanism is also
referred to as a window mechanism.
o Multiplexing: Multiplexing is a process of accepting the data from different
applications and forwarding to the different applications on different computers.
At the receiving end, the data is forwarded to the correct application. This
process is known as demultiplexing. TCP transmits the packet to the correct
application by using the logical channels known as ports.
o Logical Connections: The combination of sockets, sequence numbers, and
window sizes, is called a logical connection. Each connection is identified by the
pair of sockets used by sending and receiving processes.
o Full Duplex: TCP provides Full Duplex service, i.e., the data flow in both the
directions at the same time. To achieve Full Duplex service, each TCP should have
sending and receiving buffers so that the segments can flow in both the
directions. TCP is a connection-oriented protocol. Suppose the process A wants
to send and receive the data from process B. The following steps occur:
o Establish a connection between two TCPs.
o Data is exchanged in both the directions.
o The Connection is terminated.
Where,
o Source port address: It is used to define the address of the application program
in a source computer. It is a 16-bit field.
o Destination port address: It is used to define the address of the application
program in a destination computer. It is a 16-bit field.
o Sequence number: A stream of data is divided into two or more TCP segments.
The 32-bit sequence number field represents the position of the data in an
original data stream.
o Acknowledgement number: A 32-field acknowledgement number acknowledge
the data from other communicating devices. If ACK field is set to 1, then it
specifies the sequence number that the receiver is expecting to receive.
o Header Length (HLEN): It specifies the size of the TCP header in 32-bit words.
The minimum size of the header is 5 words, and the maximum size of the header
is 15 words. Therefore, the maximum size of the TCP header is 60 bytes, and the
minimum size of the TCP header is 20 bytes.
o Reserved: It is a six-bit field which is reserved for future use.
o Control bits: Each bit of a control field functions individually and independently.
A control bit defines the use of a segment or serves as a validity check for other
fields.
o URG: The URG field indicates that the data in a segment is urgent.
o ACK: When ACK field is set, then it validates the acknowledgement number.
o PSH: The PSH field is used to inform the sender that higher throughput is needed
so if possible, data must be pushed with higher throughput.
o RST: The reset bit is used to reset the TCP connection when there is any
confusion occurs in the sequence numbers.
o SYN: The SYN field is used to synchronize the sequence numbers in three types
of segments: connection request, connection confirmation ( with the ACK bit
set ), and confirmation acknowledgement.
o FIN: The FIN field is used to inform the receiving TCP module that the sender has
finished sending data. It is used in connection termination in three types of
segments: termination request, termination confirmation, and acknowledgement
of termination confirmation.
o Window Size: The window is a 16-bit field that defines the size of the
window.
o Checksum: The checksum is a 16-bit field used in error detection.
o Urgent pointer: If URG flag is set to 1, then this 16-bit field is an offset
from the sequence number indicating that it is a last urgent data byte.
o Options and padding: It defines the optional fields that convey the
additional information to the receiver.
1. Dialog Control –
Session layer allows two systems to enter into a dialog exchange mechanism
which can either be full or half-duplex.
2. Managing Tokens –
The communicating systems in a network try to perform some critical
operations and it is Session Layer
which prevents collisions which might occur while performing these operations
which would otherwise result in a loss.
3. Synchronization –
Checkpoints are the midway marks that are added after a particular interval
during stream of data
transfer. These points are also referred to as synchronization points. The
Session layer permits process to add these checkpoints.
For example, suppose a file of 400 pages is being sent over a network, then it is
highly beneficial to set up a checkpoint after every 50 pages so that next 50
pages are sent only when previous pages are received and acknowledged.
Design Issues with Session Layer :
Disadvantage:
The disadvantage of lossy is that decompression of data compressed through
lossy will not return the same data (in terms of quality, size, etc.). Still, it will
hold similar information (this, in fact, is useful in some instances, such as
streaming or downloading content on the internet). However, on the flip side,
constant downloading and uploading of a file can compress and consequently
distort it beyond the point of recognition, causing permanent information loss.
Similarly, if a severe level of compression is used by the user, then the output
file might not be anywhere close to the original input file.
Lossless Compression
Lossless compression, unlike lossy compression, doesn’t remove any data;
instead, it transforms it to reduce its size. To understand the concept, we can
take a simple example.
There is a piece of text where the word ‘because’ is repeated quite often. The
term is comprised of seven letters, and by using a shorthand or abbreviated
version of it like ‘bcz’, we can transform the text. This information of replacing
‘because’ with ‘bcz’ can be stored in a dictionary for later use (during
decompression).
Methodology: While lossy compression removes redundant or
unnoticeable pieces of data to reduce the size, lossless compression
transforms it through encoding it by using some formula or logic.
Here’s how lossless compression works.
Advantages and disadvantages of Lossless Compression
Advantage:
There are types of data where lossy compression is not feasible. For example, in
a spreadsheet, software, program, or any data comprised of factual text or
numbers, lossy cannot work as every number might be essential and can’t be
considered redundant as any reduction will immediately cause loss of
information. Here lossless compression becomes crucial as, upon
decompression, the file can be restored to its original state without losing any
data.
Disadvantage:
There is a limit to data compression. If data is already compressed, then
compressing it again will result in little to no reduction in its size. Also, it is less
effective against larger file sizes.
Following are the most common data compression models-
Components
There are various components of cryptography which are as follows −
The original message, before being transformed, is called plaintext. After the
message is transformed, it is called ciphertext. An encryption algorithm
transforms the plaintext into ciphertext; a decryption algorithm transforms the
ciphertext back into plaintext. The sender uses an encryption algorithm, and the
receiver uses a decryption algorithm.
Cipher
Key
Types
There are two types of cryptography which are as follows −
Asymmetric-Key Cryptography
Application Layer
The application layer is an abstraction layer that defines the
interface methods and shared communication protocols used
by hosts in a communications network. It is the layer closest to
the end-user.
Client-Server Model
The Client-server model is a distributed application structure that partitions task or
workload between the providers of a resource or service, called servers, and service
requesters called clients. In the client-server architecture, when the client computer
sends a request for data to the server through the internet, the server accepts the
requested process and deliver the data packets requested back to the client. Clients do
not share any of their resources. Examples of Client-Server Model are Email, World
Wide Web, etc.
How the Client-Server Model works ?
In this article we are going to take a dive into the Client-Server model and have a look
at how the Internet works via, web browsers. This article will help us in having a solid
foundation of the WEB and help in working with WEB technologies with ease.
Client: When we talk the word Client, it mean to talk of a person or an
organization using a particular service. Similarly in the digital world
a Client is a computer (Host) i.e. capable of receiving information or using a
particular service from the service providers (Servers).
Servers: Similarly, when we talk the word Servers, It mean a person or
medium that serves something. Similarly in this digital world a Server is a
remote computer which provides information (data) or access to particular
services.
So, its basically the Client requesting something and the Server serving it as long as its
present in the database.
How the browser interacts with the servers ?
There are few steps to follow to interacts with the servers a client.
User enters the URL(Uniform Resource Locator) of the website or file. The
Browser then requests the DNS(DOMAIN NAME SYSTEM) Server.
DNS Server lookup for the address of the WEB Server.
DNS Server responds with the IP address of the WEB Server.
Browser sends over an HTTP/HTTPS request to WEB Server’s
IP (provided by DNS server).
Server sends over the necessary files of the website.
Browser then renders the files and the website is displayed. This rendering is
done with the help of DOM (Document Object Model)
interpreter, CSS interpreter and JS Engine collectively known as the JIT or
(Just in Time) Compilers.
Advantages of Client-Server model:
Centralized system with all data in a single place.
Cost efficient requires less maintenance cost and Data recovery is possible.
The capacity of the Client and Servers can be changed separately.
Disadvantages of Client-Server model:
Clients are prone to viruses, Trojans and worms if present in the Server or
uploaded into the Server.
Server are prone to Denial of Service (DOS) attacks.
Data packets may be spoofed or modified during transmission.
Phishing or capturing login credentials or other useful information of the user
are common and MITM(Man in the Middle) attacks are common.
Cloud
1. The application layer, which is at the top of the stack, is where the actual
cloud apps are located. Cloud applications, as opposed to traditional
applications, can take advantage of the automatic-scaling functionality to
gain greater performance, availability, and lower operational costs.
2. This layer consists of different Cloud Services which are used by cloud users.
Users can access these applications according to their needs. Applications are
divided into Execution layers and Application layers.
3. In order for an application to transfer data, the application layer determines
whether communication partners are available. Whether enough cloud
resources are accessible for the required communication is decided at the
application layer. Applications must cooperate in order to communicate, and
an application layer is in charge of this.
4. The application layer, in particular, is responsible for processing IP traffic
handling protocols like Telnet and FTP. Other examples of application layer
systems include web browsers, SNMP protocols, HTTP protocols, or HTTPS,
which is HTTP’s successor protocol.
FTP
FTP stands for File Transfer Protocol . It is the protocol that actually lets us transfer
files. It can facilitate this between any two machines using it. But FTP is not just a
protocol but it is also a program.FTP promotes sharing of files via remote computers
with reliable and efficient data transfer. The Port number for FTP is 20 for data and 21
for control.
SMTP
It stands for Simple Mail Transfer Protocol . It is a part of the TCP/IP protocol. Using a
process called “store and forward,” SMTP moves your email on and across networks. It
works closely with something called the Mail Transfer Agent (MTA) to send your
communication to the right computer and email inbox. The Port number for SMTP is
25.
DNS
It stands for Domain Name System. Every time you use a domain name, therefore, a
DNS service must translate the name into the corresponding IP address. For example,
the domain name www.abc.com might translate to 198.105.232.4.
The Port number for DNS is 53.
HTTP/HTTPS
HTTP stands for Hypertext Transfer Protocol and HTTPS is the more secured version
of HTTP, that’s why HTTPS stands for Hypertext Transfer Protocol Secure. This
protocol is used to access data from the World Wide Web. The Hypertext is the well-
organized documentation system that is used to link pages in the text document.
HTTP is based on the client-server model.
It uses TCP for establishing connections.
HTTP is a stateless protocol, which means the server doesn’t maintain any
information about the previous request from the client.
HTTP uses port number 80 for establishing the connection.
Feature www (World DNS (Domain Email FTP (File Transfer HTTP (Hypertext
Wide Web) Name (Electronic Protocol) Transfer Protocol)
System) Mail)
Purpose Indicates Translates Facilitates Enables file Facilitates
resources on domain electronic transfer transfer of web
the Web. names to IPs. messaging content
Function Identifies web Facilitates IP Enables email Facilitates file Governs transfer
servers/websit address communicati transfers. of web content.
es. lookup. on.
Communic Retrieves web Resolves Text and file- File transfer Requesting and
ation Type content. domain based between systems. receiving web
names. messages. data.
Protocols Typically uses Primarily Uses SMTP, Uses FTP or SFTP Primarily uses
Used HTTP/HTTPS. uses DNS POP3, IMAP protocols. HTTP/HTTPS.
protocol. protocols.
Data Hypertext, Translated IP Text and file Various file types. Hypertext,
Format multimedia addresses. attachments. multimedia
content. content.
Example www.example. Resolving user@exampl ftp:// http://
com www.exampl e.com example.com/ www.example.co
e.com file.txt m
Connectio Stateful Stateless Stateless Stateless Stateless
n Type (persistent (request- (store-and- (command- (request-
connection). response). forward). response). response).
Security Can use DNSSEC Encryption Supports secure Can use HTTPS for
SSL/TLS for enhances during transit variants like FTPS, secure
secure security. (TLS). SFTP. communication.
browsing.
Port Defaults to Defaults to Defaults to Defaults to ports Defaults to port
Number port 80 for port 53. ports 25, 110, 20, 21 for data 80 for HTTP, 443
HTTP, 443 for 143 for SMTP, and control. for HTTPS.
HTTPS. POP3, IMAP.
User Typically uses No direct Requires user Requires user Can use various
Authentica username/pas user authenticatio authentication for authentication
tion sword, or authenticatio n (login access. methods.
other n. credentials).
authentication
methods.