Computer Network Module - 3
Computer Network Module - 3
In the OSI (Open System Interconnection) model, the transport layer is one of the
seven layers and it is responsible for the end to end communication between the
sender and receiver over the internet. It provides logical communication between the
sender and receiver and ensures the end to end delivery of the packet.
The transport layer main protocols are as follows −
● TCP (Transmission Control Protocol)
● UDP (User Datagram Protocol)
● SCTP (Stream Control Transmission Protocol)
● RDP (Reliable Data Protocol)
● RUDP (Reliable User Datagram Protocol)
Challenges
The main challenges to designing a transport layer protocol are given below −
● Dynamic Topology − Technology is changing day by day and it affects the
performance of the transport layer and will be slightly affected by these changes.
● Power and Bandwidth constraints − In a wireless network, two main
constraints of power and bandwidth are faced. These constraints affect the
transport layer.
● To handle congestion control, reliability and flow control separately − If we
handle congestion control, reliability and flow control separately then the
performance of the transport layer is increased. But to handle these separately is
the additional control overhead.
When the segment sent by Host-1 reaches the destination, i.e., host -2, the receiving
server checks to see if there is a process that has done a LISTEN on the port given in
the destination port field. If not, it sends a response with the RST bit on to refuse the
connection. Otherwise, it governs the TCP segment to the listing process, which can
accept or decline (for example, if it does not look similar to the client) the connection.
Call Collision
If two hosts try to establish a connection simultaneously between the same two
sockets, then the events sequence is demonstrated in the figure under such
circumstances. Only one connection is established. It cannot select both the links
because their endpoints identify connections.
Suppose the first set up results in a connection identified by (x, y) and the second
connection are also released up. In that case, only tail enter will be made, i.e., for (x, y)
for the initial sequence number, a clock-based scheme is used, with a clock pulse
coming after every 4 microseconds. For ensuring additional safety when a host
crashes, it may not reboot for sec, which is the maximum packet lifetime. This is to
make sure that no packets from previous connections are roaming around.
UDP
o UDP stands for User Datagram Protocol.
o UDP is a simple protocol and it provides nonsequenced transport functionality.
o UDP is a connectionless protocol.
o This type of protocol is used when reliability and security are less important than speed
and size.
o UDP is an end-to-end transport level protocol that adds transport-level addresses,
checksum error control, and length information to the data from the upper layer.
o The packet produced by the UDP protocol is known as a user datagram.
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.
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.
Definition TCP establishes a virtual circuit before UDP transmits the data directly to the destination
transmitting the data. computer without verifying whether the receiver
is ready to receive or not.
acknowledgement It waits for the acknowledgement of It neither takes the acknowledgement, nor it
data and has the ability to resend the retransmits the damaged frame.
lost packets.
Session Layer
It is one of the parts of the upper layers. The Application Layer, Presentation Layer, and
Session Layers form the OSI reference model's upper layers. They provide
user-oriented services. The session layer provides a defined set of services to the
presentation layer
Presentation Layer uses session layer protocols and transport services. The session
layer service’s actual user is the application layer through which the presentation layer
lies between them. It has relatively few features as compared to lower layers. It controls
structures and the interaction between the application programme.
It synchronizes the interaction between elements and controls the direction of
information flow, but it is not taken. It has nothing to do with error detection and
correction functions. It provides services to the presentation layer. The service definition
and protocol specifications are defined in ISO 8326 and ISO 8327.
Design Issues
The session layer is the thinnest layer with the most negligible numbers of protocols in
the OSI model. The session layer objective is to create, maintain and synchronize
dialogs between transmitting upper layers. Communication can take place between
either users or applications.
Dialog Management
The session layer aims to decide whose turn it is to talk. Some of the applications
operate in half-duplex mode. The half-duplex provides two sides alternate
communication between sending and receiving messages and never sending data
simultaneously.
The dialog management is implemented using a data token transmitted back and forth
to provide a user with a right to transmit only when it possesses the token.
Activity Management
The session layer enables the user to delimit data into logical units called activities.
Each activity is treated as a separate activity and independent from the preceding and
following activities to that activity.
Activities are used to delimit files of a multi-file transfer. Activities are used for
quarantining, collecting all the data of a multi-message exchange together before
processing them. The receiving application begins processing data only after all the
data arrives. This ensures that all or none of a set of operations is performed.
For example, a bank transaction may involve locking a record, updating a value, and
unlocking the record. When an application processes the first operation but could not
receive the remaining operations due to the client or network failures. The record will
remain locked forever. Quarantining solves this problem.
Presentation Layer
The sixth layer of the OSI reference model is the presentation layer. This layer is
concerned with the issue relating to the external data representation. It is up to the
session layer that we have assumed the user data as a string of bits, and we have
discussed the conditions for reliable transfer of this bit stream from one end system to
another.
The presentation layer, irrespective of the internal data representation, encodes the
information into an external indication that the other end system’s presentation layer is
well understood.
The function of the presentation layer is to encode the structured data (i.e., data to be
transmitted which can be tricky even) from the internal format of the source machine to
a bit stream suitable for transmission and then to decode it to the required
representation at the destination which can be then understood by the user there.
Data Representation
For storage and process of data, different computers use diverse internal
representation of data. There are various types of character sets like American code for
information interchange (ASCII), extended binary coded decimal interchange code
(EBCDIC), binarycoded decimal (BCD) codes etc.
Similarly, for integer representation, most microcomputers use two complement
arithmetic on 16 to 32-bit integers. Some computers use one’s complement
representation, and some use even up to 60 bits one's complement.
Some computers number their bytes from right to left while others from left to right.
Because of these differences, even if the data is transmitted correctly and received
correctly, the resultant values can differ from those of the shared values.
Data Compression
Data Compression is a widely used technique to save space in memory (main memory)
and secondary storage devices like a disk, magnetic tapes etc. In general, data
transmission used on computer networks uses public or private networks which require
payment for their efforts.
The cost is usually calculated in terms of time or the amount of data sent. If it is a fixed
monthly or yearly subscription, i.e., fixed charges, we typically don't need extra
techniques. But if the cost depends on the volume of data, then the data compression
technique is a boon for users.
Data compression is closely related to data representation because if a particular data
needs 10 bytes for its expression, a few bits appear again and again in that data. Then
by representing those standard bits in a specific manner, it can reduce it to 4 bytes.
This can be done by using codes and several times, its repetition or some other way.
Similarly, if a string contains the maximum percentage of positive integers, they can be
sent in a single unsigned byte if most of them are between 0 and 255.
In such cases, a code is transmitted before the byte to indicate an actual integer of
more bits (example 32 bits follows).
Network Security
One of the major problems during data transmissions on networks is to protect the data
from unauthorized users. This is dealt with under the security and privacy of networks.
As the network mostly belongs to single organizations in older days, maintaining
privacy and security control was more accessible.
But nowadays, as the network does not belong to a single organization, it is also
challenging to ensure that the data sent is not copied and accessed by unauthorized
users. Wiretapping is widespread.
Worst of all, it is in satellite links where the data is available to anyone who uses an
antenna and tries to capture the data from the transmission channel secretly.
These security services should perform the following functions:
● It is used for data protection from unauthorized accessors.
● It can provide prevention from unauthorized deletion.
● It can give prevention from the unauthorized insertion of messages.
● It can verify each message sent to the sender
● It is used to provide a way to send signed documents electrically.
● It is used to provide a way to make data incomprehensible to all but their intended
recipients.
Network Security
Network security is the security provided to a network from unauthorized access and
risks. It is the duty of network administrators to adopt preventive measures to protect
their networks from potential security threats.
Computer networks that are involved in regular transactions and communication within
the government, individuals, or business require security. The most common and simple
way of protecting a network resource is by assigning it a unique name and a
corresponding password.
Types of Network Security Devices
Active Devices
These security devices block the surplus traffic. Firewalls, antivirus scanning devices,
and content filtering devices are the examples of such devices.
Passive Devices
These devices identify and report on unwanted traffic, for example, intrusion detection
appliances.
Preventative Devices
These devices scan the networks and identify potential security problems. For example,
penetration testing devices and vulnerability assessment appliances.
Unified Threat Management (UTM)
These devices serve as all-in-one security devices. Examples include firewalls, content
filtering, web caching, etc.
Firewalls
A firewall is a network security system that manages and regulates the network traffic
based on some protocols. A firewall establishes a barrier between a trusted internal
network and the internet.
Firewalls exist both as software that run on a hardware and as hardware appliances.
Firewalls that are hardware-based also provide other functions like acting as a DHCP
server for that network.
Most personal computers use software-based firewalls to secure data from threats from
the internet. Many routers that pass data between networks contain firewall components
and conversely, many firewalls can perform basic routing functions.
Firewalls are commonly used in private networks or intranets to prevent unauthorized
access from the internet. Every message entering or leaving the intranet goes through
the firewall to be examined for security measures.
An ideal firewall configuration consists of both hardware and software based devices. A
firewall also helps in providing remote access to a private network through secure
authentication certificates and logins.
Hardware and Software Firewalls
Hardware firewalls are standalone products. These are also found in broadband routers.
Most hardware firewalls provide a minimum of four network ports to connect other
computers. For larger networks − e.g., for business purpose − business networking
firewall solutions are available.
Software firewalls are installed on your computers. A software firewall protects your
computer from internet threats.
Antivirus
An antivirus is a tool that is used to detect and remove malicious software. It was
originally designed to detect and remove viruses from computers.
Modern antivirus software provide protection not only from virus, but also from worms,
Trojan-horses, adwares, spywares, keyloggers, etc. Some products also provide
protection from malicious URLs, spam, phishing attacks, botnets, DDoS attacks, etc.
Content Filtering
Content filtering devices screen unpleasant and offensive emails or webpages. These
are used as a part of firewalls in corporations as well as in personal computers. These
devices generate the message "Access Denied" when someone tries to access any
unauthorized web page or email.
Content is usually screened for pornographic content and also for violence- or
hate-oriented content. Organizations also exclude shopping and job related contents.
Content filtering can be divided into the following categories −
● Web filtering
● Screening of Web sites or pages
● E-mail filtering
● Screening of e-mail for spam
● Other objectionable content
Translation
It changes the complex data structures used by an application string, integers,
structures, etc., into a byte stream that may be transmitted across the network. The
message is represented so that communicating machines agree to the format of the
data being exchanged. For example, ASCII or EBCDIC character sets.
The translation may be direct or indirect. In the direct translation method, ASCII code is
translated as the EBCDIC at the destination machine. In the indirect method, the ASCII
code is first translated to a standard format at the source machine before transmission.
Encryption/Decryption
It deals with security and privacy issues. Encryption is used to scramble the data so
that only authorized persons can unscramble the conversation data. Decryption
reverses the encryption process to translate the message back into its original form.
The sender in the source machine uses an encryption algorithm and a key to transform
the plaintext (original message) into a cipher text (encrypted message) to encrypt the
data. At the destination machine, the reverse process takes place. The receiver has a
key and decryption algorithm to translate back the ciphertext into the original plaintext.
There are two types of Encryption which are as follows−
Asymmetric Encryption
Two mathematically related keys, the name public key and private keys, are generated
to encrypt and decrypt the message. Asymmetric encryption is considered more secure
than symmetric encryption.
Asymmetric key encryption that involves a key pair as public and private keys involves
six major steps−
● Plaintext− Plaintext is the text message to which an algorithm is applied.
● Encryption Algorithm− It provides mathematical operations to conduct substitutions
and transformations to the plaintext.
● Public and Private Keys− They constitute a pair of keys that are used for the encryption
and decryption of the message.
● Cipher text− Application of an algorithm on plaintext produces an encrypted or
scrambled message.
● Decryption Algorithm− This algorithm is applied to generate the cipher text and the
matching key to have the plaintext.
Symmetric Encryption
Symmetric encryption, also referred to as conventional or single key Encryption, is
based on a secret key, which both communicating parties share. The sending party
encrypts the plain text to cipher text message using the secret key. The receiving party
on receipt of the cipher text message uses the same secret key to decrypt it to plain
text. Examples of symmetric encryption are the RSA algorithm.
Symmetric Notes encryption method has the following five major parts−
● Plaintext− Plaintext is the text message to which an algorithm is applied.
● Encryption Algorithm− It provides mathematical operations to conduct substitutions
and transformations to the plaintext.
● Secret Key− They constitute a part of the algorithm for the encryption and decryption of
the message.
● Cipher text− This is the encrypted message generated by applying the algorithm to the
plaintext message using the secret key.
● Decryption Algorithm− This encryption algorithm decrypts the cipher text into plain text
by using the cipher text and the secret key.
Authentication
It checks the antecedents of the remote party being the real party rather than an
impostor. It defines that the message is received from an authentic person, not from an
impostor. A digital signature is one of the several authentication approaches that use
the public key encryption method.
Data Compression
It compresses data to decrease the amount of transmitted information, thus saving in
bandwidth and money. There are three general methods of data compression. Each
method considers that the data stream may be transformed into a more compact
representation. This compact data stream is reconstructed back into the original data at
the destination machine.