Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

MODULE 6

Transport Layer – TCP & UDP. Application layer –FTP, DNS,


Electronic mail, MIME, SNMP. Introduction to World Wide Web.
TRANSPORT LAYER
In computer networking, a transport layer provides end-to-end or host-to-host
communication services for applications within a layered architecture of network
components and protocols. The transport layer provides services such as
connection-oriented data stream support, reliability, flow control, and
multiplexing.

Transport layer implementations are contained in both the TCP/IP model (RFC
1122), which is the foundation of the Internet, and the Open Systems
Interconnection (OSI) model of general networking, however, the definitions of
details of the transport layer are different in these models.

The best-known transport protocol is the Transmission Control


C
Protocol (TCP). It is used for connection-oriented transmissions, whereas the
connectionless User Datagram Protocol (UDP) is used for simpler messaging
SA

transmissions.

Transmission Control Protocol (TCP)


A Packet in TCP is called a segment. The below diagram shows the format of the
segment. The segment consists of a 20 to 60 byte header, followed by data from
Downloaded from Ktunotes.in
the application program. The header is 20 bytes if there are no options and up to 60
bytes if it contains options.


C
Header – The header is composed of a 20-byte fixed part and an optional part with
SA

a variable length. The total size of the header (in 32-bit words) is specified in
HLEN.

Data - The data can have a variable size, which can be up to 65535 – 20 = 65515
bytes.
Source port number (16 bits) – The SOURCE PORT field identifies the TCP
process which sent the datagram.
Destination port number (16 bits) – The DESTINATION PORT field identifies the
TCP process which is receiving the datagram.
Sequence number (32 bits) – The SEQUENCE NUMBER field identifies the first
byte of the outgoing data. The receiver uses this to re-order segments arriving out
of order and to compute an acknowledgement number.
Acknowledgement number (32 bits) – Contains the next sequence number that the
sender of the acknowledgement expects to receive which is the sequence number
plus 1 (plus the number of bytes received in the last message). This number is used
only if the ACK flag is on. The
ACKNOWLEDGEMENT NUMBER field identifies the sequence number of the
incoming data that is expected next.
Downloaded from Ktunotes.in
Header Length – This 4-bit field indicates the number of 4-byte words in the TCP
header. The length of the header can be between 20 and 60 bytes.

Reserved – This is a 6-bit field reserved for future use.


Code bits – The CODE BITS (or FLAGS) field contains one or more 1-bit flags
– Control bits to indicate end of stream, acknowledgement field being valid,
connection reset, urgent pointer field being valid, etc.

Window Size(16 bit) – The WINDOW field identifies how much buffer space is
available for incoming data.
During piggybacking, how much data a receiver is willing to accept.
Note: The process of sending data along with the acknowledgment is called
piggybacking
Checksum(16 bit) – The CHECKSUM field contains a simple checksum over the
TCP segment header and data.
Urgent Pointer (16 bit) – This 16-bit field, which is valid only if the urgent flag is
set, is used when the segment contains urgent data. It defines the number that must
be added to the sequence number to obtain the number of the last urgent byte in the
data section of the segment.
Options – There can be up to 40 bytes of optional information in the TCP header.
C
TCP is connection-oriented. A connection-oriented transport protocol establishes a
SA

virtual path between the source and destination. All the segments belonging to a
message are then sent over this virtual path. Using a single virtual pathway for the
entire message facilitates the acknowledgement process as well as retransmission
of damaged or lost frames. TCP, which uses the services of IP, a connection-less
protocol, can be connection-oriented. TCP uses the services of IP to deliver
individual segments to the receiver, but it controls the connection itself. If a
segment is lost or corrupted, it is retransmitted.
In TCP connection-oriented transmission requires two phases:
• Connection establishment and Data transfer
• Connection termination

Connection establishment:
TCP transmits data in full-duplex mode. When two TCP’s in two machines or
connected, they are able to send segments to each other simultaneously.
Three-way handshaking.
The connection establishment in TCP is called three way handshaking. The process
starts with the server. The server program tells its TCP that it is ready to accept a
connection. This is called a request for a passive open.
Downloaded from Ktunotes.in
The client program issues a request for an active open. A client that wishes to
connect to an open server tells its TCP that it needs to be connected to that
particular server. TCP can now start the three-way handshaking process.

The three steps in this phase are as follows.


1. The client sends the first segment, a SYN segment, in which only the SYN flag
is set. This segment is for synchronization of sequence numbers. It consumes one
sequence number. When the data transfer starts, the sequence number is
incremented by 1. A SYN segment cannot carry data, but it consumes one
sequence number.

2. The server sends the second segment, a SYN + ACK segment, with 2 flag bits
set: SYN and ACK. This segment has a dual pupose. It is a SYN segment for
communication in the other direction and serves as the acknowledgement for the
SYN segment. It consumes one sequence number.

3. The client sends the third segment. This is just an ACK segment. It
acknowledges the receipt of the second segmant with the ACK flag and
acknowledgment number field.
C
Data Transfer
SA

After connection is established, bidirectional data transfer can take place. The
client and server can both send data and acknowledgements.

UDP:
The User Datagram Protocol (UDP) is one of the core members of the Internet
protocol suite. The protocol was designed by David P.

UDP uses a simple connectionless transmission model with a minimum of protocol


mechanism. It has no handshaking dialogues, and thus exposes any unreliability of
the underlying network protocol to the user's program. There is no guarantee of
delivery, ordering, or duplicate protection. UDP provides checksums for data
integrity, and port numbers for addressing different functions at the source and
destination of the datagram.

With UDP, computer applications can send messages, in this case


referred to as datagram, to other hosts on an Internet Protocol (IP) network without
prior communications to set up special transmission channels or data paths. UDP is
Downloaded from Ktunotes.in
suitable for purposes where error checking and correction is either not necessary or
is performed in the application, avoiding the overhead of such processing at the
network interface level.

If error correction facilities are needed at the network interface level, an


application may use the Transmission Control Protocol (TCP) or Stream Control
Transmission Protocol (SCTP)
UDP (User Datagram Protocol) is an alternative communications protocol To
Transmission Control Protocol (TCP) used primarily for establishing low-latency
and loss tolerating connections between applications on the Internet. Both UDP
and TCP run on top of the Internet Protocol (IP) and are sometimes referred to as
UDP/IP or TCP/IP. Both protocols send short packets of data, called datagram.

UDP provides two services not provided by the IP layer. It provides port numbers
to help distinguish different user requests and, optionally, a checksum capability to
verify that the data arrived intact.

UDP is an ideal protocol for network applications in which perceived latency is


critical such as gaming, voice and video communications, which can suffer some
C
data loss without adversely affecting perceived quality. In some cases, forward
SA

error correction techniques are used to improve audio and video quality in spite of
some loss.

COMPARISION BETWEEN TCP AND UDP

TCP UDP
Acronym for Transmission Control Protocol User Datagram Protocol or
Universal Datagram Protocol
Connection TCP is a connection-oriented UDP is a connectionless
protocol. protocol
Function As a message makes its way across UDP is also a protocol used in
the internet from one computer to message transport or transfer.
another. This is connection based. This is not connection based
which means that one program
can send a load of packets to
Downloaded from Ktunotes.in
another and that would be the
end of the relationship.

Usage TCP is suited for applications that UDP is suitable for


require high reliability, and applications that need fast,
transmission time is relatively less efficient transmission, such as
critical. games. UDP's stateless nature
is also useful for servers that
answer small queries from
huge numbers of clients.

Use by other HTTP, HTTPs, FTP, SMTP, Telnet DNS, DHCP, TFTP, SNMP,
protocols RIP, VOIP.

Ordering of Segment sequencing. No Segment sequencing.


data packets
TCP rearranges data packets in the UDP has no inherent order as
order specified all packets are independent of
each other. If ordering is
C
required, it has to be managed
SA

by the application layer.

Speed of The speed for TCP is slower than UDP is faster because error
transfer UDP. recovery is not attempted. It is
a "best effort" protocol.

Reliability Reliable, There is absolute guarantee Unreliable ,There is no


that the data transferred remains guarantee that the messages or
intact and arrives in the same order packets sent would reach at all.
in which it was sent.

Header Size TCP header size is 20 bytes UDP Header size is 8 bytes

Common Source port, Destination port, Check Source port, Destination port,
Header Fields Sum Check Sum

Streaming of Data is read as a byte stream, no Packets are sent individually


Downloaded from Ktunotes.in
data distinguishing indications are and are checked for integrity
transmitted to signal message only if they arrive. Packets
(segment) boundaries. have definite boundaries which
are honored upon receipt,
meaning a read operation at the
receiver socket will yield an
entire message as it was
originally sent.

Weight TCP is heavy-weight. TCP requires UDP is lightweight. There is no


three packets to set up a socket ordering of messages, no
connection, before any user data can tracking connections, etc. It is a
be sent. TCP handles reliability and small transport layer designed
congestion control. on top of IP.

Data Flow TCP does Flow Control. TCP UDP does not have an option
Control requires three packets to set up a for flow control
socket connection, before any user
C
data can be sent. TCP handles
SA

reliability and congestion control.


Error Checking TCP does error checking and error UDP does error checking but
recovery. Erroneous packets are simply discards erroneous
retransmitted from the source to the packets. Error recovery is not
destination. attempted.

Fields 1. Sequence Number, 2. AcK 1. Length, 2. Source port, 3.


number, 3. Data offset, 4. Reserved, Destination port, 4. Check Sum
5. Control bit, 6. Window, 7. Urgent
Pointer 8. Options, 9. Padding, 10.
Check Sum, 11. Source port, 12.
Destination port
Acknowledgement Acknowledgement segments. No Acknowledgment

Acknowledge sequencing. No Acknowledge sequencing

Downloaded from Ktunotes.in


Handshake SYN, SYN-ACK, ACK No handshake (connectionless
protocol)

APPLICATION LAYER
FTP
File Transfer Protocol (FTP) is the standard mechanism provided by
TCP/IP for copying a file from one host to another. Although transferring files
from one system to another seems simple and straightforward, some problems
must be dealt with first. For example, two systems may use different file name
conventions. Two systems may have different ways to represent text and data.

Two systems may have different directory structures. All these problems have been
solved by FTP in a very simple and elegant approach.
FTP differs from other client/server applications in that it establishes two
connections between the hosts. One connection is used for data transfer, the other
for control informationSeparation of commands and data transfer makes FTP more
C
efficient. The control connection uses very simple rules of communication. We
need to transfer only a line of command or a line of response at a time.
SA

FTP uses two well-known TCP ports: Port 21 is used for the control connection,
and port 20 is used for the data connection.

Downloaded from Ktunotes.in


Figure 26.21 shows the basic model of FTP. The client has three components: user
interface, client control process, and the client data transfer process. The server has
C

two components: the server control process and the server data transfer process.
SA

The control connection is made between the control processes. The data
connection is made between the data transfer processes.

DNS
The DNS translates Internet domain and host names to IP addresses. DNS
automatically converts the names we type in our Web browser address bar to the IP
addresses of Web servers hosting those sites.

Downloaded from Ktunotes.in


C
SA

The names assigned to computers must be selected from a name space. The name
must be unique because the addresses are unique. A namespace that maps each
address to a unique name can organize in two ways.
1. Flat Namespace
2. Hierarchical Namespace
Flat NamespaceA name is assigned to an address. A name in this space is a
sequence of characters without structure. The main disadvantage of flat namespace
is that, it cannot use in a large system such as the internet.
Hierarchical Namespace Each name is made of several parts. The first part can
defined the nature of the organization, the second part can defined the name, and
the third part can define department and so on. The authority to assign and control
the namespaces can be decentralized.
Domain Hierarchy:
DNS is hierarchical in structure. A domain is a subtree of the domain name space.
All the related information about a particular network (generally maintained by an
organization, firm or university) should be available at one place. The organization
Downloaded from Ktunotes.in
should have complete control over what it includes in its network and how does it
"organize" its network.

Domain Name
A name that identifies one or more IP addresses. For example, the domain name
microsoft.com represents about a dozen IP addresses. Domain names are used in
URLs to identify particular Web pages. For example, in the URL
http://www.pcwebopedia.com/index.html, the domain name is pcwebopedia.com.

Types of Domain Name


1. Fully Qualified Domain Name (FQDN)
2. Partially Qualified Domain Name (PQDN)
1. FQDN: A fully qualified domain name (FQDN) consists of the host name plus
domain name. e.g. computername.domain.com
2. PQDN: A partially Qualified Domain Name (PQDN) stats from a node, but it
does not reach the root. E.g. computername
Three main components of DNS
1. Resolver
2. Name server
C
3. Database of Resource Records(RRs)
Resolver: A host that needs to map an address to a name or a name to an address
SA

calls a DNS client called a resolver. The resolver accesses the closest DNS server
with a mapping request. If the server has the information, its satisfies the resolver;
after the resolver receives the mapping, it interprets the response to see if it’s a real
resolution or an error, and finally delivers the result to the process that requested it.

Name Servers
The first step is to partition the hierarchy into sub trees called zones. Each zone can
be thought of a corresponding to some administrative authority that is responsible
for that portion of the hierarchy.
DNS server is used to distribute the information among many computers.
Specifically, the information contained in each zone is implemented in two or more
name servers for the sake of redundancy, that is, the information is still available
even if one name server fails. Each name server, in turn, is a program that can be
accessed over the Internet.
There are two types of records are used in DNS.
1. The question records
2. Resource Records
Downloaded from Ktunotes.in
The question records: Is used by the client to get information from a server. This
contains a domain name.
Resource Records: Each domain name is associated with a record called the
resource record. The server database consists of resource records. The resource
records are used in the answer, authoritative and additional information section of
the response message.

ELECTRONIC MAIL
One of the most popular Internet services is electronic mail (e-mail). The designers
of the Internet probably never imagined the popularity of this application program.
At the beginning of the Internet era, the messages sent by electronic mail were
short and consisted of text only; they let people exchange quick memos. Today,
electronic mail is much more complex. It allows a message to include text, audio,
and video. It also allows one message to be sent to one or more recipients.
Architecture
User Agent
The first component of an electronic mail system is the user agent. It provides
C
service to the user to make the process of sending and receiving a message easier.
Services Provided by a User Agent
SA

A user agent is a software package (program) that composes, reads, replies to, and
forwards messages. It also handles mailboxes. Figure 26.11 shows the services of a
typical user agent.

Composing Messages
A user agent helps the user compose the e-mail message to be sent out. Most user
agents provide a template on the screen to be filled in by the user. Some even have
a built-in editor thatDownloaded
can do spell checking, grammar checking, and other tasks
from Ktunotes.in
expected from a sophisticated word processor. A user, of course, could
alternatively use his or her favorite text editor or word processor to create the
message and import it, or cut and paste it, into the user agent template.
Reading Messages
The second duty of the user agent is to read the incoming messages. When a user
invokes a user agent, it first checks the mail in the incoming mailbox. Most user
agents show a one-line summary of each received mail. Each e-mail contains the
following fields.
1. A number field.
2. A flag field that shows the status of the mail such as new, already read but not
replied to, or read and replied to.
3. The size of the message.
4. The sender.
5. The optional subject field.
Replying to Messages
After reading a message, a user can use the user agent to reply to a message. A user
agent usually allows the user to reply to the original sender or to reply to all
recipients of the message. The reply message may contain the original message and
the new message.
Forwarding Messages
C
Replying is defined as sending a message to the sender or recipients of the copy.
SA

Forwarding is defined as sending the message to a third party. A user agent allows
the receiver to forward the message, with or without extra comments, to a third
party.
Handling Mailboxes
A user agent normally creates two mailboxes: an inbox and an outbox. Each box is
a file with a special format that can be handled by the user agent. The inbox keeps
all the received e-mails until they are deleted by the user. The outbox keeps all the
sent e-mails until the user deletes them. Most user agents today are capable of
creating customized mailboxes.
User Agent Types
There are two types of user agents: command-driven and GUI-based.
Command-Driven: Command-driven user agents belong to the early days of
electronic mail. They are still present as the underlying user agents in servers. A
command-driven user agent normally accepts a one-character command from the
keyboard to perform its task.

Downloaded from Ktunotes.in


MIME
Multipurpose Internet Mail Extensions (MIME) is an Internet standard
that extends the format of email to support:
1.Text in character sets other than ASCII
2.Non-text attachments: audio, video, images, application programs etc.
3.Message bodies with multiple parts
4.Header information in non-ASCII character sets
Virtually all human-written Internet email and a fairly large proportion of
automated email is transmitted via SMTP in MIME format.

MIME-Version
The presence of this header indicates the message is MIME-formatted. The value is
typically "1.0" so this header appears as MIME-Version: 1.0
According to MIME co-creator Nathaniel Borenstein, the intention was to allow
MIME to change, to advance to version 2.0 and so forth, but this decision led to the
opposite outcome, making it nearly impossible to create a new version of the
standard.
Content-Type
This header indicates the Internet media type of the message content, consisting of
C
a type and subtype, for example
SA

Content-Type: text/plain
Through the use of the multipart type, MIME allows mail messages to have parts
arranged in a tree structure where the leaf nodes are any non-multipart content type
and the non-leaf nodes are any of a variety of multipart types.

Multipurpose Internet Mail Extensions, a specification for formatting non-ASCII


messages so that they can be sent over the Internet. Many e-mail clients now
support MIME, which enables them to send and receive graphics, audio, and video
files via the Internet mail system. In addition, MIME supports messages in
character sets other than ASCII.
There are many predefined MIME types, such as GIF graphics files and PostScript
files. It is also possible to define your own MIME types. In addition to e-mail
applications, Web browsers also support various MIME types. This enables the
browser to display or output files that are not in HTML format.
MIME (Multi-Purpose Internet Mail Extensions) is an extension of the original
Internet e-mail protocol that lets people use the protocol to exchange different
kinds of data files on the Internet: audio, video, images, application programs, and

Downloaded from Ktunotes.in


other kinds, as well as the ASCII text handled in the original protocol, the Simple
Mail Transport Protocol (SMTP).
MIME (Multi-Purpose Internet Mail Extensions) is an extension of the original
Internet e-mail protocol that lets people use the protocol to exchange different
kinds of data files on the Internet: audio, video, images, application programs, and
other kinds, as well as the ASCII text handled in the original protocol, the Simple
Mail Transport Protocol (SMTP).

SNMP
SNMP is a frame work for managing devices in an internet using TCP/IP suite.
It provides fundamental operations for monitoring and maintaining an internet.

➢ SNMP uses the concept of manager and agent. Manager usually a host
controls and monitors a set of agents, usually routers. A management station,
called a manager, is a host that runs the SNMP client program. A managed
station, called an agent, is a router or host that runs the SNMP server
program.
➢ Management is achieved through simple interaction between a manager and
C

an agent. The agent keeps performance information in a database. The


SA

manager has access to the values in the database.


Management with SNMP is based on three basic ideas
1. A manager checks an agent by requesting information that reflects the behavior
of the agent.
2. A manager forces an agent to perform a task by resetting values in the agent
database.
3. An agent contributes the management process by warning the manager of an
unusual situation.

Role of SNMP
SNMP has some very specific roles in network management. It defines the format
of the packet to be send from a manager to an agent and vice versa. It also
interprets the result and creates statistics. The packet exchange contains the object
names (variables) and their status (values). SNMP is response for reading and
changing these values.

Downloaded from Ktunotes.in


C
SA

SNMP messages:
SNMP does not send only a PDU, it embeds the PDU in a message. A message in
SNMPv3 is made of four elements: version, header, security parameter and data.
The version, defines the current version (3)
The header contains values for message identification, maximum message size,
message flag and a message security model.
The message security parameter is used to create a message digest.
The data contain the PDU. If the data are encrypted, there is information about the
encrypting engine and the encrypting context followed by the encrypted PDU. If
the data are not encrypted, the data consist of just the PDU.

UDP Ports:
SNMP uses the services of UDP on two well-known ports, 161 and 162. The well-
known port 161 is used by the server (agent), and the well-known port 162 is used
by the client (Manager).
Security:
SNMPv3 provides two types of security: general and specific.
Downloaded from Ktunotes.in
SNMPv3 provides message authentication, privacy, and manager authorization.
SNMPv3 allows a manager remotely change the security configuration, which
means that the manager does not have to be physically present at the manager
station.

INTRODUCTION TO WORLD WIDE WEB

WWW stands for World Wide Web. A technical definition of the World Wide
Web is : all the resources and users on the Internet that are using the Hypertext
Transfer Protocol (HTTP).

In simple terms, The World Wide Web is a way of exchanging information


between computers on the Internet, tying them together into a vast collection of
interactive multimedia resources.

Identifiers and Character Set


Uniform Resource Identifier (URI) is used to uniquely identify resources on the
web and UNICODE makes it possible to built web pages that can be read and
C

write in human languages.


SA

Syntax
XML (Extensible Markup Language) helps to define common syntax in
semantic web.
Data Interchange
Resource Description Framework (RDF) framework helps in defining core
representation of data for web. RDF represents data about resource in graph form.
Taxonomies
RDF Schema (RDFS) allows more standardized description of taxonomiesand
other ontological constructs.
Ontologies
Web Ontology Language (OWL) offers more constructs over RDFS. It comes in
following three versions:
• OWL Lite for taxonomies and simple constraints.
• OWL DL for full description logic
Downloaded support.
from Ktunotes.in
• OWL for more syntactic freedom of RDF
Rules
RIF and SWRL offers rules beyond the constructs that are available
from RDFs and OWL. Simple Protocol and RDF Query Language
(SPARQL) is SQL like language used for querying RDF data and OWL
Ontologies.
Proof
All semantic and rules that are executed at layers below Proof and their result will
be used to prove deductions.
Cryptography
Cryptography means such as digital signature for verification of the origin of
sources is used.
User Interface and Applications
On the top of layer User interface and Applications layer is built for user
interaction.
C
WWW Operation
SA

WWW works on client- server approach. Following steps explains how the web
works:
1. User enters the URL (say, http://www.tutorialspoint.com) of the web page
in the address bar of web browser.
2. Then browser requests the Domain Name Server for the IP address
corresponding to www.tutorialspoint.com.
3. After receiving IP address, browser sends the request for web page to the
web server using HTTP protocol which specifies the way the browser and
web server communicates.
4. Then web server receives request using HTTP protocol and checks its
search for the requested web page. If found it returns it back to the web
browser and close the HTTP connection.
5. Now the web browser receives the web page, It interprets it and display the
contents of web page in web browser’s window.
Downloaded from Ktunotes.in
Future
There had been a rapid development in field of web. It has its impact in almost
every area such as education, research, technology, commerce, marketing etc. So
the future of web is almost unpredictable.
Apart from huge development in field of WWW, there are also some technical
issues that W3 consortium has to cope up with.
C
User Interface
SA

Work on higher quality presentation of 3-D information is under development.


The W3 Consortium is also looking forward to enhance the web to full fill
requirements of global communities which would include all regional languages
and writing systems.
Technology
Work on privacy and security is under way. This would include hiding
information, accounting, access control, integrity and risk management.
Architecture
There has been huge growth in field of web which may lead to overload the
internet and degrade its performance. Hence more better protocol is required to be
developed.

Downloaded from Ktunotes.in

You might also like