Understanding the Transport Layer in TCP/IP
Understanding the Transport Layer in TCP/IP
• The transport layer in the TCP/IP suite is located between the application layer and the network layer.
It provides services to the application layer and receives services from the network layer.
• The transport layer acts as a liaison between a client program and a server program, a process-to-
process connection. The transport layer is the heart of the TCP/IP protocol suite; it is the end-to-end
logical vehicle for transferring data from one point to another in the Internet.
• Communication is provided using a logical connection, which means that the two application layers,
which can be located in different parts of the globe, assume that there is an imaginary direct
connection through which they can send and receive messages.
• At the data link layer, two routers communicate directly via a physical channel, whether wired or
wireless, whereas at the transport layer, this physical channel is replaced by the entire network.
• For one thing, over point-to-point links such as wires or optical fiber, it is usually not necessary for a
router to specify which router it wants to talk to—each outgoing line leads directly to a particular
router. In the transport layer, explicit addressing of destinations is required.
• For another thing, the process of establishing a connection over the wire of Fig. 4.6(a) is simple: the
other end is always there (unless it has crashed, in which case it is not there). Either way, there is not
much to do.
• Even on wireless links, the process is not much different. Just sending a message is sufficient to have
it reach all other destinations. If the message is not acknowledged due to an error, it can be resent. In
the transport layer, initial connection establishment is complicated.
1. Addressing:
• When an application (e.g., a user) process wishes to set up a connection to a remote application
process, it must specify which one to connect to. (Connectionless transport has the same problem:
to whom should each message be sent?) The method normally used is to define transport addresses
to which processes can listen for connection requests.
• In the Internet, these endpoints are called ports. We will use the generic term TSAP (Transport Service
Access Point) to mean a specific endpoint in the transport layer. The analogous endpoints in the
network layer (i.e., network layer addresses) are naturally called NSAPs (Network Service Access
Points). IP addresses are examples of NSAPs.
• Figure 4.7 illustrates the relationship between the NSAPs, the TSAPs, and a transport connection.
3. Connection Release:
• Releasing a connection is easier than establishing one. There are two styles of terminating a
connection: asymmetric release and symmetric release.
• Asymmetric release is the way the telephone system works: when one party hangs up, the
connection is broken.
• Symmetric release treats the connection as two separate unidirectional connections and requires
each one to be released separately.
• Asymmetric release is abrupt and may result in data loss. Consider the scenario of Fig. 4.9. After the
connection is established, host 1 sends a segment that arrives properly at host 2. Then host 1 sends
another segment.
• Unfortunately, host 2 issues a DISCONNECT before the second segment arrives. The result is that the
connection is released and data are lost.
• Symmetric release does the job when each process has a fixed amount of data to send and clearly
knows when it has sent it. In other situations, determining that all the work has been done and the
connection should be terminated is not so obvious.
• One can envision a protocol in which host 1 says ‘‘I am done. Are you done too?’’ If host 2 responds:
‘‘I am done too. Goodbye, the connection can be safely released.’’
• In practice, we can avoid this quandary (meaning dilemma/difficulty) by foregoing the need for
agreement and pushing the problem up to the transport user, letting each side independently decide
when it is done. This is an easier problem to solve.
Figure 4.10: Four protocol scenarios for releasing a connection. (a) Normal case of three-way handshake.
(b) Final ACK lost. (c) Response lost. (d) Response lost and subsequent DRs lost.
THE INTERNET TRANSPORT PROTOCOLS
• The Internet has two main protocols in the transport layer, a connectionless protocol and a
connection-oriented one. The protocols complement each other.
• The connectionless protocol is UDP. It does almost nothing beyond sending packets between
applications, letting applications build their own protocols on top as needed.
• The connection-oriented protocol is TCP. It does almost everything. It makes connections and adds
reliability with retransmissions, along with flow control and congestion control, all on behalf of the
applications that use it.
1. Introduction to Udp:
• The Internet protocol suite supports a connectionless transport protocol called UDP (User Datagram
Protocol).
• UDP provides a way for applications to send encapsulated IP datagrams without having to establish
a connection. UDP is described in RFC 768.
• UDP transmits segments consisting of an 8-byte header followed by the payload. The header is shown
in Fig. 4.16. The two ports serve to identify the endpoints within the source and destination machines.
• When a UDP packet arrives, its payload is handed to the process attached to the destination
port. This attachment occurs when the BIND primitive or something similar is used.
• The checksum algorithm is simply to add up all the 16-bit words in one’s complement and to take the
one’s complement of the sum.
• In a certain sense, sending a message to a remote host and getting a reply back is a lot like making a
function call in a programming language. The idea behind RPC is to make a remote procedure call look
as much as possible like a local one.
• In the simplest form, to call a remote procedure, the client program must be bound with a small library
procedure, called the client stub that represents the server procedure in the client’s address space.
• Similarly, the server is bound with a procedure called the server stub. These procedures hide the
fact that the procedure call from the client to the server is not local. The actual steps in making an
RPC are shown in Fig. 4.17.
Step 1 is the client calling the client stub. This call is a local procedure call, with the parameters
pushed onto the stack in the normal way.
Step 2 is the client stub packing the parameters into a message and making a system call to send
the message. Packing the parameters is called marshaling.
Step 3 is the operating system sending the message from the client machine to the server machine.
The reply traces the same path in the other direction.
• The key item to note here is that the client procedure, written by the user, just makes a normal (i.e.,
local) procedure call to the client stub, which has the same name as the server procedure. Since the
client procedure and client stub are in the same address space, the parameters are passed in the usual
way.
• Similarly, the server procedure is called by a procedure in its address space with the
parameters it expects. To the server procedure, nothing is unusual.
• Client-server RPC is one area in which UDP is widely used. Another one is for real-time multimedia
applications.
• In particular, as Internet radio, Internet telephony, music-on-demand, videoconferencing, video-on-
demand, and other multimedia applications became more commonplace, people have discovered
that each application was reinventing more or less the same real-time transport protocol. Thus was
RTP (Real-time Transport Protocol) born?
• It is described in RFC 3550 and is now in widespread use for multimedia applications. There are two
aspects of real-time transport. The first is the RTP protocol for transporting audio and video data in
packets. The second is the processing that takes place, mostly at the receiver, to play out the audio
and video at the right time.
• The basic function of RTP is to multiplex several real-time data streams onto single stream of UDP
packets. The UDP stream can be sent to a single destination (unicasting) or to multiple destinations
(multicasting).
• Because RTP just uses normal UDP, its packets are not treated specially by the routers unless some \
• normal IP quality-of-service features are enabled. In particular, there are no special guarantees about
delivery, and packets may be lost, delayed, corrupted, etc.
• The RTP format contains several features to help receivers work with multimedia information. The
RTP header is illustrated in Fig. 4.18. It consists of three 32-bit words and potentially some extensions.
• The first word contains the Version field, which is already at 2.
• The P bit indicates that the packet has been padded to a multiple of 4 bytes.
• The X bit indicates that an extension header is present.
• The CC field tells how many contributing sources are present, from 0 to 15.
• The M bit is an application-specific marker bit. It can be used to mark the start of a video frame, the
start of a word in an audio channel, or something else that the application understands.
• The Payload type field tells which encoding algorithm has been used (e.g., uncompressed 8-bit
audio, MP3, etc.).
• The Sequence number is just a counter that is incremented on each RTP packet sent. It is used to
detect lost packets.
• The Timestamp is produced by the stream’s source to note when the first sample in the packet was
made.
• The Synchronization source identifier tells which stream the packet belongs to. It is the method used
to multiplex and demultiplex multiple data streams onto single stream of UDP packets.
• Finally, the Contributing source identifiers, if any, are used when mixers are present.
• RTP has a little sister protocol (little sibling protocol?) called RTCP (Realtime Transport Control
Protocol). It is defined along with RTP in RFC 3550 and handles feedback, synchronization, and the
user interface. It does not transport any media samples.
• The first function can be used to provide feedback on delay, variation in delay or jitter, bandwidth,
congestion, and other network properties to the sources. This information can be used by the
encoding process to increase the data rate (and give better quality) when the network is functioning
well and to cut back the data rate when there is trouble in the network. By providing continuous
feedback, the encoding algorithms can be continuously adapted to provide the best quality possible
under the current circumstances.
• RTCP also handles interstream synchronization. The problem is that different streams may use
different clocks, with different granularities and different drift rates. RTCP can be used to keep them
in sync.
• Finally, RTCP provides a way for naming the various sources (e.g., in ASCII text). This information can
be displayed on the receiver’s screen to indicate who is talking at the moment.
II. TCP (Transmission Control Protocol):
• UDP is a simple protocol and it has some very important uses, such as client server interactions and
multimedia, but for most Internet applications, reliable, sequenced delivery is needed. UDP cannot
provide this, so another protocol is required. It is called TCP and is the main workhorse of the Internet.
1. Introduction to TCP:
• TCP (Transmission Control Protocol) was specifically designed to provide a reliable end-to-end byte
stream over an unreliable internetwork. An internetwork differs from a single network because
different parts may have wildly different topologies, bandwidths, delays, packet sizes, and other
parameters.
• TCP was designed to dynamically adapt to properties of the internetwork and to be robust in theface
of many kinds of failures. TCP was formally defined in RFC 793 in September 1981.
• As time went on, many improvements have been made, and various errors and inconsistencies have
been fixed. To give you a sense of the extent of TCP, the important RFCs are now RFC 793 plus:
clarifications and bug fixes in RFC 1122; extensions for high-performance in RFC 1323.
• Selective acknowledgements in RFC 2018; congestion control in RFC 2581; repurposing of header
fields for quality of service in RFC 2873; improved retransmission timers in RFC 2988; and explicit
congestion notification in RFC 3168. The IP layer gives no guarantee that datagrams will be delivered
properly, nor any indication of how fast datagrams may be sent.
• It is up to TCP to send datagrams fast enough to make use of the capacity but not cause congestion,
and to time out and retransmit any datagrams that are not delivered. Datagrams that do arrive may
well do so in the wrong order; it is also up to TCP to reassemble them into messages in the proper
sequence.
.
Figure 4.19: Some assigned ports
• All TCP connections are full duplex and point-to-point. Full duplex means that traffic can go in both
directions at the same time. Point-to-point means that each connection has exactly two end points.
TCP does not support multicasting or broadcasting.
• A TCP connection is a byte stream, not a message stream. Message boundaries are not preserved end
to end.
• A key feature of TCP, and one that dominates the protocol design, is that every byte on a TCP
connection has its own 32-bit sequence number. When the Internet began, the lines betweenrouters
were mostly 56-kbps leased lines, so a host blasting away at full speed took over 1 week to cycle
through the sequence numbers.
• The sending and receiving TCP entities exchange data in the form of segments. A TCP segment consists
of a fixed 20-byte header (plus an optional part) followed by zero or more data bytes. The TCP
software decides how big segments should be.
• It can accumulate data from several writes into one segment or can split data from one write over
multiple segments. Two limits restrict the segment size. First, each segment, including the TCP header,
must fit in the 65,515- byte IP payload. Second, each link has an MTU (Maximum Transfer Unit).
• Each segment must fit in the MTU at the sender and receiver so that it can be sent and received in a
single, unfragmented packet. However, it is still possible for IP packets carrying TCP segments to be
fragmented when passing over a network path for which some link has a small MTU.
• If this happens, it degrades performance and causes other problems. Instead, modern TCP
implementations perform path MTU discovery by using the technique outlined in RFC 1191. This
technique uses ICMP error messages to find the smallest MTU for any link on the path. TCP then
adjusts the segment size downwards to avoid fragmentation.
• The basic protocol used by TCP entities is the sliding window protocol with a dynamic window size.
When a sender transmits a segment, it also starts a timer. When the segment arrives at the
destination, the receiving TCP entity sends back a segment (with data if any exist, and otherwise
without) bearing an acknowledgement number equal to the next sequence number it expects to
receive and the remaining window size.
• If the sender’s timer goes off before the acknowledgement is received, the sender transmits the
segment again
• Figure 4.20 shows the layout of a TCP segment. Every segment begins with a fixed-format, 20-byte
header. The fixed header may be followed by header options. After the options, if any, up to 65,535
− 20 − 20 = 65,495 data bytes may follow, where the first 20 refer to the IP header and the second to
the TCP header.
• Segments without any data are legal and are commonly used for acknowledgements and control
messages.
Figure 4.20: The TCP Header
• The Source port and Destination port fields identify the local end points of the connection. The source
and destination end points together identify the connection. This connection identifier is called a 5
tuple because it consists of five pieces of information: the protocol (TCP), source IP and source port,
and destination IP and destination port.
• The Sequence number and Acknowledgement number fields perform their usual functions.
• The TCP header length tells how many 32-bit words are contained in the TCP header. This information
is needed because the Options field is of variable length, so the header is, too.
• Now come eight 1-bit flags. CWR and ECE are used to signal congestion when ECN (Explicit Congestion
Notification) is used. CWR is set to signal Congestion Window Reduced from the TCP sender to the
TCP receiver so that it knows the sender has slowed down and can stop sending the ECN-Echo.
• URG is set to 1 if the Urgent pointer is in use. The Urgent pointer is used to indicate a byte offset from
the current sequence number at which urgent data are to be found.
• The ACK bit is set to 1 to indicate that the Acknowledgement number is valid. This is the case for nearly
all packets. If ACK is 0, the segment does not contain an acknowledgement, so the Acknowledgement
number field is ignored.
• The PSH bit indicates PUSHed data. The receiver is hereby kindly requested to deliver the data to
the application upon arrival and not buffer it until a full buffer has been received (which it might
otherwise do for efficiency).
• The RST bit is used to abruptly reset a connection that has become confused due to a host crash or
some other reason.
• The SYN bit is used to establish connections. The FIN bit is used to release a connection.
• The Window size field tells how many bytes may be sent starting at the byte acknowledged.
• A Checksum is also provided for extra reliability. The Options field provides a way to add extra facilities
not covered by the regular header.
• Connections are established in TCP by means of the three-way handshake. To establish a connection,
one side, say, the server passively waits for an incoming connection by executing the LISTEN and
ACCEPTS primitives in that order, either specifying a specific source or nobody in particular.
• The other side, say, the client, executes a CONNECT primitive, specifying the IP address and port to
which it wants to connect, the maximum TCP segment size it is willing to accept, and optionally
some user data (e.g., a password). The CONNECT primitive sends a TCP segment with the SYN bit on
and ACK bit off and waits for a response.
• When this segment arrives at the destination, the TCP entity their 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 reply with the
RST bit on to reject the connection.
• If some process is listening to the port, that process is given the incoming TCP segment. It can either
accept or reject the connection. If it accepts, an acknowledgement segment is sent back. Thesequence
of TCP segments sent in the normal case is shown in Fig. 4.21(a). Note that a SYN segment consumes
1 byte of sequence space so that it can be acknowledged unambiguously.
Figure 4.21 (a) TCP connection establishment in the normal case. (b) Simultaneous
Connection establishment on both sides.
• In the event that two hosts simultaneously attempt to establish a connection between the same two
sockets, the sequence of events is as illustrated in Fig.4.21 (b). The result of these events is that just
one connection is established, not two, because connections are identified by their end points. If the
first setup results in a connection identified by (x, y) and the second one does too, only one table entry
is made, namely, for (x, y).
• Although TCP connections are full duplex, to understand how connections are released it is best to
think of them as a pair of simplex connections. Each simplex connection is released independently of
its sibling.
• To release a connection, either party can send a TCP segment with the FIN bit set, which means that
it has no more data to transmit. When the FIN is acknowledged, that direction is shut down for new
data.
• Data may continue to flow indefinitely in the other direction, however. When both directions have
been shut down, the connection is released.
• The steps required establishing and release connections can be represented in a finite state machine
with the 11 states listed in Fig. 4.22. In each state, certain events are legal. When a legal event
happens, some action may be taken. If some other event happens, an error is reported.
• Each connection starts in the CLOSED state. It leaves that state when it does either a passive open
(LISTEN) or an active open (CONNECT). If the other side does the opposite one, a connection is
established and the state becomes ESTABLISHED. Connection release can be initiated by either side.
When it is complete, the state returns to CLOSED.
Figure 4.22: The states used in the TCP connection management finite state machine.
• TCP connection management finite state machine is shown in Fig. 4.23. The common case of a client
actively connecting to a passive server is shown with heavy lines—solid for the client, dotted for the
server. The lightface lines are unusual event sequences.
Figure 4.23. TCP connection management finite state machine. The heavy solid line is the normal path for a
client. The heavy dashed line is the normal path for a server. The light lines are unusual events. Each
transition is labeled with the event causing it and the action resulting from it, separated by a slash.
8. TCP Sliding Window:
• Window probe is a packet sent by the sender, who can send a 1-byte segment to force the receiver
to reannounce the next byte expected and the window size.
• Delayed acknowledgements is an optimization, where the idea is to delay acknowledgements and
window updates for up to 500 msec in the hope of acquiring some data on which to hitch a free
ride.
• Nagle’s algorithm is a way to reduce the bandwidth wastage by a sender that sends multiple short
packets (e.g., 41-byte packets containing 1 byte of data).
• When data come into the sender in small pieces, just send the first piece and buffer all the rest until
the first piece is acknowledged. Then send all the buffered data in one TCP segment and start buffering
again until the next segment is acknowledged.
• Silly window syndrome is a problem that occurs when data are passed to the sending TCP entity in
large blocks, but an interactive application on the receiving side reads data only 1 byte at a time.
• Clark’s solution is to prevent the receiver from sending a window update for 1 byte. Instead, it is
forced to wait until it has a decent amount of space available and advertise that instead.
• Nagle’s algorithm and Clark’s solution to the silly window syndrome are complementary. Nagle was
trying to solve the problem caused by the sending application delivering data to TCP a byte at a time.
Clark was trying to solve the problem of the receiving application sucking the data up from TCP a byte
at a time.
• Both solutions are valid and can work together. The goal is for the sender not to send smallsegments
and the receiver not to ask for them.
• Retransmission timer: When a segment is sent, a retransmission timer is started. If the segment is
acknowledged before the timer expires, the timer is stopped. If, on the other hand, the timer goes off
before the acknowledgement comes in, the segment is retransmitted (and the timer started again).
• Persistence timer is designed to prevent a deadlock situation where, the sender keeps waiting for a
window update from the receiver, which is lost. When the persistence timer goes off, the sender
transmits a probe to the receiver. The response to the probe gives the window size.
• Keep alive timer: When a connection has been idle for a long time, the keep alive timer may go off to
cause one side to check whether the other side is still there. If it fails to respond, the connectionis
terminated.
• To deal with the two problems of receiver’s capacity and network capacity, each sender maintains
two windows: the window the receiver has granted and a second window, the congestion window.
• Each reflects the number of bytes the sender may transmit. The number of bytes that may be sent is
the minimum of the two windows.
• When a connection is established, the sender initializes the congestion window to the size of the
maximum segment in use on the connection. It then sends one maximum segment. Each burst
acknowledged doubles the congestion window.
• The congestion window keeps growing exponentially until either a timeout occurs or the receiver's
window is reached. This algorithm is called slow start.
• Internet congestion control algorithm uses a third parameter, the threshold, initially 64 KB, in addition
to the receiver and congestion windows. When a timeout occurs, the threshold is set to half of the
current congestion window, and the congestion window is reset to one maximumsegment.
• Another proposal is SCTP (Stream Control Transmission Protocol). Its features include message
boundary preservation, multiple delivery modes (e.g., unordered delivery), multihoming (backup
destinations), and selective acknowledgements
III. PERFORMANCE PROBLEMS IN COMPUTER NETWORKS:
• Some performance problems, such as congestion, are caused by temporary resource overloads. If
more traffic suddenly arrives at a router than the router can handle, congestion will build up and
performance will suffer.
• Performance also degrades when there is a structural resource imbalance. For example, if a gigabit
communication line is attached to a low-end PC, the poor host will not be able to process the incoming
packets fast enough and some will be lost. These packets will eventually be retransmitted, adding
delay, wasting bandwidth, and generally reducing performance.
• Overloads can also be synchronously triggered. As an example, if a segment contains a bad parameter,
in many cases the receiver will thoughtfully send back an error notification.
• Another tuning issue is setting timeouts. When a segment is sent, a timer is set to guard against loss
of the segment. If the timeout is set too short, unnecessary retransmissions will occur, clogging the
wires. If the timeout is set too long, unnecessary delays will occur after a segment is lost.
• When a network performs poorly, its users often complain to the folks running it, demanding
improvements. To improve the performance, the operators must first determine exactly what is going
on. To find out what is really happening, the operators must make measurements.
• Measurements can be made in different ways and at many locations (both in the protocol stack and
physically). The most basic kind of measurement is to start a timer when beginning some activity
and see how long that activity takes.
• Other measurements are made with counters that record how often some event has happened (e.g.,
number of lost segments).
• Measuring network performance and parameters has many potential pitfalls. We list a few of them
here. Any systematic attempt to measure network performance should be careful to avoid these.
1) Make Sure That the Sample Size Is Large Enough
• Do not measure the time to send one segment, but repeat the measurement, says, one million times
and takes the average.
2) Make Sure That the Samples Are Representative
• Ideally, the whole sequence of one million measurements should be repeated at different times of
the day and the week to see the effect of different network conditions on the measured quantity.
3) Caching Can Wreak Havoc with Measurements
• Repeating a measurement many times will return an unexpectedly fast answer if the protocols use
caching mechanisms.
4) Be Sure That Nothing Unexpected Is Going On during Your Tests
• Making measurements at the same time that some user has decided to run a video conference over
your network will often give different results than if there is no video conference.
5) Be Careful When Using a Coarse-Grained Clock
• Computer clocks function by incrementing some counter at regular intervals.
6) Be Careful about Extrapolating the Results:
• Suppose that you make measurements with simulated network loads running from 0 (idle) to 0.4 (40%
of capacity).
Simple Transport Protocol
Introduction to Simple Transport Protocol (STP): Simple Transport Protocol (STP) is a simplified
version of transport protocols, designed to provide basic data transmission functionalities over a
network. It is often used in educational contexts or lightweight applications that do not require the full
complexity of protocols like TCP or UDP.
Key Features:
1. Connection-Oriented: STP establishes a connection between sender and receiver before transmitting
data, similar to TCP.
2. Reliable Data Transfer: STP ensures data is delivered without loss or duplication. Acknowledgments
are used to confirm successful receipt.
3. Segmenting and Reassembling: Data is broken down into smaller segments for transmission and
reassembled at the receiver’s end.
4. Error Detection: STP incorporates mechanisms to detect errors in data transmission using checksums.
5. Flow Control: It regulates the flow of data between sender and receiver to prevent congestion or
overload.
STP Operation:
1. Connection Setup:
o Before data transmission, STP sets up a connection between the sender and the receiver. This
involves a handshake process, which typically involves sending special control messages to
synchronize the connection.
2. Data Transmission:
o Once the connection is established, the sender begins to transmit data in the form of
segments.
o Each segment includes a header containing information like sequence numbers and error-
checking data (e.g., checksum).
3. Acknowledgments:
o The receiver sends back an acknowledgment (ACK) after successfully receiving a segment. If an
error is detected, the receiver requests retransmission.
4. Flow Control:
o STP monitors how fast data is being received and adjusts the sending rate to avoid congestion.
It may pause transmission if the receiver's buffer is full.
5. Connection Termination:
o After all data has been sent and acknowledged, the connection is gracefully closed through a
termination process, often involving another handshake.
Advantages of STP:
Disadvantages of STP:
• Limited Functionality: Compared to TCP or other advanced transport protocols, STP lacks many
sophisticated features (e.g., congestion control, advanced flow control).
• Not Scalable for Large Networks: STP is generally used in small, simple network environments.
Use Cases:
NETWORK SECURITY
Network security is the practice of protecting a computer network from unauthorized access,
misuse, or attacks. It involves using tools, technologies, and policies to ensure that data traveling
over the network is safe and secure, keeping sensitive information away from hackers and other
threats.
NETWORK SECURITY ISSUES
1. Secrecy- confidentiality
2. Authentication – assurance
3. Integrity – authorized parties modify the data.
4. Non repudiation-deny the transmission
5. Access control - restricting the access
6. Availability - authorized users anytime access the information.
Cryrtography:
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
known as algorithms to convert messages in ways that make it hard to decode them.
Plaintext:
• Definition: Plaintext refers to the original, readable data or message before it is encrypted. It
can be any form of information like text, email, passwords, or files that you want to keep
secure.
• Example:
o Plaintext message: "HELLO"
CIPHER TEXT:
unreadable version of the original message, and it can only be converted back into plaintext through
the process of decryption using the correct key.
Encryption is the process of converting data into a code to prevent unauthorized access. It transforms
readable information (plaintext) into an unreadable format (ciphertext), which can only be
understood by someone with the correct decryption key.
Example of Encryption:
Imagine you want to send a message, "HELLO", to a friend, but you want to keep it secret. You could
use a Caesar Cipher, which is a basic encryption technique where each letter in the message is shifted
by a certain number of places in the alphabet.
• Plaintext: "HELLO"
• Shift: 3
Each letter is replaced by the letter that comes 3 places after it in the alphabet:
• H→K
• E→H
• L→O
• L→O
• O→R
DECRYPTION:
Decryption in a network setting refers to the process of converting encrypted data back into its
original, readable format using a decryption key. This is often used in secure communications over a
network to protect data from being accessed by unauthorized parties.
CAESER CIPHER METHOD:
A simple example of a substitution cipher is called the Caesar cipher, sometimes called a shift cipher.
In this approach, each letter is replaced with a letter some fixed number of positions later in the
alphabet. For example, if we use a shift of 3, then the letter A would be replaced with D, the letter 3
positions later in the alphabet. The entire mapping would look like: [1]
Original: ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
MONOALPHABETIC CIPHER:
A monoalphabetic cipher is a type of substitution cipher where each letter in the plaintext is replaced
with a corresponding letter from a fixed substitution alphabet. Unlike a polyalphabetic cipher, which
uses multiple substitution alphabets, a monoalphabetic cipher uses only one throughout the entire
message.
To encrypt a message, we first create a substitution alphabet. Let's say we decide to shift the
alphabet by 3 letters:
• Plain Alphabet: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
• Cipher Alphabet: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Let’s encrypt the plaintext message "HELLO" using the substitution alphabet.
• H→K
• E→H
• L→O
• L→O
• O→R
Decryption Process
To decrypt, we simply reverse the substitution using the same substitution alphabet.
• K→H
• H→E
• O→L
• O→L
• R→O
• Plaintext: "HELLO"
• Ciphertext: "KHOOR"
• Substitution Method: Each letter is shifted by 3 positions in the alphabet.
TRANSPOSITION CIPHER:
A transposition cipher is a method of encryption where the positions of characters in the plaintext are
shifted according to a certain system, but the actual characters remain unchanged. In contrast to
substitution ciphers, which change the characters themselves, transposition ciphers rearrange the
letters of the plaintext.
========================================================