Transport Layer CN

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

Transport Layer

Types of Service
The transport layer also determines the type of service provided to the users from the
session layer. An error-free point-to-point communication to deliver messages in the
order in which they were transmitted is one of the key functions of the transport layer.

Error Control
Error detection and error recovery are an integral part of reliable service, and therefore
they are necessary to perform error control mechanisms on an end-to-end basis. To
control errors from lost or duplicate segments, the transport layer enables unique
segment sequence numbers to the different packets of the message, creating virtual
circuits, allowing only one virtual circuit per session.

Flow Control
The underlying rule of flow control is to maintain a synergy between a fast process and
a slow process. The transport layer enables a fast process to keep pace with a slow
one. Acknowledgements are sent back to manage end-to-end flow control. Go back N
algorithms are used to request retransmission of packets starting with packet number
N. Selective Repeat is used to request specific packets to be retransmitted.
Connection Establishment/Release
The transport layer creates and releases the connection across the network. This
includes a naming mechanism so that a process on one machine can indicate with
whom it wishes to communicate. The transport layer enables us to establish and delete
connections across the network to multiplex several message streams onto one
communication channel.
Multiplexing/De multiplexing
The transport layer establishes a separate network connection for each transport
connection required by the session layer. To improve throughput, the transport layer
establishes multiple network connections. When the issue of throughput is not
important, it multiplexes several transport connections onto the same network
connection, thus reducing the cost of establishing and maintaining the network
connections.
When several connections are multiplexed, they call for demultiplexing at the receiving
end. In the case of the transport layer, the communication takes place only between
two processes and not between two machines. Hence, communication at the transport
layer is also known as peer-to-peer or process-to-process communication.

Fragmentation and re-assembly


When the transport layer receives a large message from the session layer, it breaks the
message into smaller units depending upon the requirement. This process is called
fragmentation. Thereafter, it is passed to the network layer. Conversely, when the
transport layer acts as the receiving process, it reorders the pieces of a message
before reassembling them into a message.
Addressing
Transport Layer deals with addressing or labelling a frame. It also differentiates
between a connection and a transaction. Connection identifiers are ports or sockets
that label each frame, so the receiving device knows which process it has been sent
from. This helps in keeping track of multiple-message conversations. Ports or sockets
address multiple conservations in the same location.

Transport Layer protocols


o The transport layer is represented by two protocols: TCP and UDP.
o The IP protocol in the network layer delivers a datagram from a source host
to the destination host.
o Nowadays, the operating system supports multiuser and multiprocessing
environments, an executing program is called a process. When a host sends
a message to other host means that source process is sending a process to a
destination process. The transport layer protocols define some connections to
individual ports known as protocol ports.
o An IP protocol is a host-to-host protocol used to deliver a packet from source
host to the destination host while transport layer protocols are port-to-port
protocols that work on the top of the IP protocols to deliver the packet from
the originating port to the IP services, and from IP services to the destination
port.
o Each port is defined by a positive integer address, and it is of 16 bits.

UDP
o UDP stands for User Datagram Protocol.
o UDP is a simple protocol and it provides non sequenced 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.

User Datagram Format


The user datagram has a 16-byte header which is shown below:

Where,

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.

Disadvantages of UDP protocol


o UDP provides basic functions needed for the end-to-end delivery of a
transmission.
o It does not provide any sequencing or reordering functions and does not
specify the damaged packet when reporting an error.
o UDP can discover that an error has occurred, but it does not specify which
packet has been lost as it does not contain an ID or sequencing number of a
particular data segment.

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.

Features Of TCP protocol

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.

TCP Segment Format

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.

There are total six types of flags in control field:


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.

Differences b/w TCP & UDP

Basis for TCP UDP


Comparison

Definition TCP establishes a UDP transmits the data


virtual circuit directly to the
before destination computer
transmitting the without verifying
data. whether the receiver
is ready to receive or
not.

Connection It is a Connection- It is a Connectionless


Type Oriented protocol protocol

Speed slow high

Reliability It is a reliable It is an unreliable


protocol. protocol.

Header size 20 bytes 8 bytes

acknowledgeme It waits for the It neither takes the


nt acknowledgement acknowledgement,
of data and has nor it retransmits the
the ability to
resend the lost damaged fram
packets.

DNS
An application layer protocol defines how the application processes running
on different systems, pass the messages to each other.

o DNS stands for Domain Name System.


o DNS is a directory service that provides a mapping between the name of a
host on the network and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a
sequence of symbols specified by dots.
o DNS is a service that translates the domain name into IP addresses. This
allows the users of networks to utilize user-friendly names when looking for
other hosts instead of remembering the IP addresses.
o For example, suppose the FTP site at EduSoft had an IP address of
132.147.165.50, most people would reach this site by specifying
ftp.EduSoft.com. Therefore, the domain name is more reliable than IP
address.

DNS is a TCP/IP protocol used on different platforms. The domain name


space is divided into three different sections: generic domains, country
domains, and inverse domain.
Generic Domains
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS
database.
o It uses three-character labels, and these labels describe the organization
type.

Label Description

aero Airlines and aerospace companies

biz Businesses or firms

com Commercial Organizations

coop Cooperative business Organizations

edu Educational institutions

gov Government institutions


info Information service providers

int International Organizations

mil Military groups

museum Museum & other nonprofit organizations

name Personal names

net Network Support centers

org Nonprofit Organizations

pro Professional individual Organizations


Country Domain
The format of country domain is same as a generic domain, but it uses two-
character country abbreviations (e.g., us for the United States) in place of
three character organizational abbreviations.

Inverse Domain
The inverse domain is used for mapping an address to a name. When the
server has received a request from the client, and the server contains the
files of only authorized clients. To determine whether the client is on the
authorized list or not, it sends a query to the DNS server and ask for mapping
an address to the name.
Working of DNS
o DNS is a client/server network communication protocol. DNS clients send
requests to the. server while DNS servers send responses to the client.
o Client requests contain a name which is converted into an IP address known
as a forward DNS lookups while requests containing an IP address which is
converted into a name known as reverse DNS lookups.
o DNS implements a distributed database to store the name of all the hosts
available on the internet.
o If a client like a web browser sends a request containing a hostname, then a
piece of software such as DNS resolver sends a request to the DNS server
to obtain the IP address of a hostname. If DNS server does not contain the IP
address associated with a hostname, then it forwards the request to another
DNS server. If IP address has arrived at the resolver, which in turn completes
the request over the internet protocol.

Electronic Mail (e-mail) is one of most widely used services of Internet. This
service allows an Internet user to send a message in formatted manner
(mail) to the other Internet user in any part of world. Message in mail not only
contain text, but it also contains images, audio and videos data. The person
who is sending mail is called sender and person who receives mail is
called recipient. It is just like postal mail service. Components of E-Mail
System : The basic components of an email system are : User Agent (UA),
Message Transfer Agent (MTA), Mail Box, and Spool file. These are explained
as following below.
1. User Agent (UA) : The UA is normally a program which is used to send and
receive mail. Sometimes, it is called as mail reader. It accepts variety of
commands for composing, receiving and replying to messages as well as for
manipulation of the mailboxes.
2. Message Transfer Agent (MTA) : MTA is actually responsible for transfer of
mail from one system to another. To send a mail, a system must have client
MTA and system MTA. It transfer mail to mailboxes of recipients if they are
connected in the same machine. It delivers mail to peer MTA if destination
mailbox is in another machine. The delivery from one MTA to another MTA is
done by Simple Mail Transfer
Protocol.

3. Mailbox : It is a file on local hard drive to collect mails. Delivered mails are
present in this file. The user can read it delete it according to his/her
requirement. To use e-mail system each user must have a mailbox . Access
to mailbox is only to owner of mailbox.
4. Spool file : This file contains mails that are to be sent. User agent appends
outgoing mails in this file using SMTP. MTA extracts pending mail from spool
file for their delivery. E-mail allows one name, an alias, to represent several
different e-mail addresses. It is known as mailing list, Whenever user have
to sent a message, system checks recipient’s name against alias database.
If mailing list is present for defined alias, separate messages, one for each
entry in the list, must be prepared and handed to MTA. If for defined alias,
there is no such mailing list is present, name itself becomes naming address
and a single message is delivered to mail transfer entity.

Services provided by E-mail system :


 Composition – The composition refer to process that creates messages
and answers. For composition any kind of text editor can be used.
 Transfer – Transfer means sending procedure of mail i.e. from the sender to
recipient.
 Reporting – Reporting refers to confirmation for delivery of mail. It help user
to check whether their mail is delivered, lost or rejected.
 Displaying – It refers to present mail in form that is understand by the user.
 Disposition – This step concern with recipient that what will recipient do
after receiving mail i.e save mail, delete before reading or delete after
reading.

What is 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.

The building blocks of the Web are web pages which are formatted in HTML
and connected by links called "hypertext" or hyperlinks and accessed by
HTTP. These links are electronic connections that link related pieces of
information so that users can access the desired information quickly.
Hypertext offers the advantage to select a word or phrase from text and thus
to access other pages that provide additional information related to that
word or phrase.
A web page is given an online address called a Uniform Resource Locator
(URL). A particular collection of web pages that belong to a specific URL is
called a website, e.g., www.facebook.com, www.google.com, etc. So, the
World Wide Web is like a huge electronic book whose pages are stored on
multiple servers across the world.

Small websites store all of their WebPages on a single server, but big
websites or organizations place their WebPages on different servers in
different countries so that when users of a country search their site they
could get the information quickly from the nearest server.

8.9M

285

Java Tricky Program 16 - Autoboxing, Inheritance and Overriding

So, the web provides a communication platform for users to retrieve and
exchange information over the internet. Unlike a book, where we move from
one page to another in a sequence, on World Wide Web we follow a web of
hypertext links to visit a web page and from that web page to move to other
web pages. You need a browser, which is installed on your computer, to
access the Web.

Difference between World Wide Web and Internet:


Some people use the terms 'internet' and 'World Wide Web' interchangeably.
They think they are the same thing, but it is not so. Internet is entirely
different from WWW. It is a worldwide network of devices like computers,
laptops, tablets, etc. It enables users to send emails to other users and chat
with them online. For example, when you send an email or chatting with
someone online, you are using the internet.
But, when you have opened a website like google.com for information, you
are using the World Wide Web; a network of servers over the internet. You
request a webpage from your computer using a browser, and the server
renders that page to your browser. Your computer is called a client who runs
a program (web browser), and asks the other computer (server) for the
information it needs.

History of the World Wide Web:

The World Wide Web was invented by a British scientist, Tim Berners-Lee in
1989. He was working at CERN at that time. Originally, it was developed by
him to fulfill the need of automated information sharing between scientists
across the world, so that they could easily share the data and results of their
experiments and studies with each other.

CERN, where Tim Berners worked, is a community of more than 1700


scientists from more than 100 countries. These scientists spend some time
on CERN site, and rest of the time they work at their universities and national
laboratories in their home countries, so there was a need for reliable
communication tools so that they can exchange information.

Internet and Hypertext were available at this time, but no one thought how
to use the internet to link or share one document to another. Tim focused on
three main technologies that could make computers understand each other,
HTML, URL, and HTTP. So, the objective behind the invention of WWW was to
combine recent computer technologies, data networks, and hypertext into a
user-friendly and effective global information system.
How the Invention Started:
In March 1989, Tim Berners-Lee took the initiative towards the invention of
WWW and wrote the first proposal for the World Wide Web. Later, he wrote
another proposal in May 1990. After a few months, in November 1990, along
with Robert Cailliau, it was formalized as a management proposal. This
proposal had outlined the key concepts and defined terminology related to
the Web. In this document, there was a description of "hypertext project"
called World Wide Web in which a web of hypertext documents could be
viewed by browsers. His proposal included the three main technologies
(HTML, URL, and HTTP).

In 1990, Tim Berners-Lee was able to run the first Web server and browser at
CERN to demonstrate his ideas. He used a NeXT computer to develop the
code for his Web server and put a note on the computer "The machine is a
server. Do Not Power It DOWN!!" So that it was not switched off accidentally
by someone.

How the World Wide Web Works?


Now, we have understood that WWW is a collection of websites connected to
the internet so that people can search and share information. Now, let us
understand how it works!
The Web works as per the internet's basic client-server format as shown in
the following image. The servers store and transfer web pages or information
to user's computers on the network when requested by the users. A web
server is a software program which serves the web pages requested by web
users using a browser. The computer of a user who requests documents from
a server is known as a client. Browser, which is installed on the user'
computer, allows users to view the retrieved documents.
All the websites are stored in web servers. Just as someone lives on rent in a
house, a website occupies a space in a server and remains stored in it. The
server hosts the website whenever a user requests its WebPages, and the
website owner has to pay the hosting price for the same.

The moment you open the browser and type a URL in the address bar or
search something on Google, the WWW starts working. There are three main
technologies involved in transferring information (web pages) from servers to
clients (computers of users). These technologies include Hypertext Markup
Language (HTML), Hypertext Transfer Protocol (HTTP) and Web browsers.

Hypertext Markup Language (HTML):


HTML is a standard markup language which is used for creating web pages. It
describes the structure of web pages through HTML elements or tags. These
tags are used to organize the pieces of content such as 'heading,'
'paragraph,' 'table,' 'Image,' and more. You don't see HTML tags when you
open a webpage as browsers don't display the tags and use them only to
render the content of a web page. In simple words, HTML is used to display
text, images, and other resources through a Web browser.

Web Browser:

A web browser, which is commonly known as a browser, is a program that


displays text, data, pictures, videos, animation, and more. It provides a
software interface that allows you to click hyperlinked resources on the
World Wide Web. When you double click the Browser icon installed on your
computer to launch it, you get connected to the World Wide Web and can
search Google or type a URL into the address bar.

In the beginning, browsers were used only for browsing due to their limited
potential. Today, they are more advanced; along with browsing you can use
them for e-mailing, transferring multimedia files, using social media sites,
and participating in online discussion groups and more. Some of the
commonly used browsers include Google Chrome, Mozilla Firefox, Internet
Explorer, Safari, and more.

Hypertext Transfer Protocol (HTTP):


Hyper Text Transfer Protocol (HTTP) is an application layer protocol which
enables WWW to work smoothly and effectively. It is based on a client-server
model. The client is a web browser which communicates with the web server
which hosts the website. This protocol defines how messages are formatted
and transmitted and what actions the Web Server and browser should take in
response to different commands. When you enter a URL in the browser, an
HTTP command is sent to the Web server, and it transmits the requested
Web Page.

When we open a website using a browser, a connection to the web server is


opened, and the browser communicates with the server through HTTP and
sends a request. HTTP is carried over TCP/IP to communicate with the server.
The server processes the browser's request and sends a response, and then
the connection is closed. Thus, the browser retrieves content from the server
for the user.

You might also like