Protocal S
Protocal S
Time to Live (TTL) 8 bits Specifies the life span of a datagram on a network. TTL is measured by the
number of hops.
Protocol 8 bits Specifies the type of the protocol carried in the datagram.
Header Checksum 16 bits A device calculates the header checksum for each datagram received. If the
checksum is 0, the device knows that the header remains unchanged and
retains the datagram. This field checks only the header but not the data.
Options 0-40 bytes Allows IPv4 to support various options such as fault handling,
(variable length) measurement, and security. Pad bytes with a value of 0 are added if
necessary.
Data Variable Pads an IP datagram .
Transmission Control Protocol (TCP)
• The Transmission Control Protocol (TCP) is one of the main
protocols of the Internet protocol suite. It originated in the
initial network implementation in which it complemented the
Internet Protocol (IP). Therefore, the entire suite is commonly
referred to as TCP/IP. TCP provides reliable, ordered, and error-
checked delivery of a stream of octets (bytes) between
applications running on hosts communicating via an IP
network. Major internet applications such as the World Wide
Web, email, remote administration, and file transfer rely on
TCP, which is part of the Transport Layer of the TCP/IP suite.
TCP cont..
• TCP is connection-oriented, and a connection between client and server is
established before data can be sent. The server must be listening (passive
open) for connection requests from clients before a connection is
established. Three-way handshake (active open), retransmission, and error
detection adds to reliability but lengthens latency. Applications that do not
require reliable data stream service may use the User Datagram Protocol
(UDP) instead, which provides a connectionless datagram service that
prioritizes time over reliability. TCP employs network congestion avoidance.
However, there are vulnerabilities in TCP, including denial of service,
connection hijacking and reset attack.
Features
• TCP is reliable protocol. That is, the receiver always sends either positive or
negative acknowledgement about the data packet to the sender, so that the
sender always has bright clue about whether the data packet is reached the
destination or it needs to resend it.
• TCP ensures that the data reaches intended destination in the same order it was
sent.
• TCP is connection oriented. TCP requires that connection between two remote
points be established before sending actual data.
• TCP provides error-checking and recovery mechanism.
• TCP provides end-to-end communication.
• TCP provides flow control and quality of service.
• TCP operates in Client/Server point-to-point mode.
• TCP provides full duplex server, i.e. it can perform roles of both receiver and
sender.
Header
The length of TCP header is minimum 20 bytes long
and maximum 60 bytes.
File Transfer Protocol (FTP)
• File Transfer Protocol (FTP) is a widely used network protocol for
transferring files between computers over a TCP/IP-based network,
such as the internet. FTP lets people and applications exchange and
share data within their offices and across the Internet. FTP was one of
the first technologies developed to solve this common need, and it
remains—with several generations of enhancements—the second
most popular protocol used today (after HTTP, or the “World Wide
Web”).
How does FTP work?
• All communication protocols operate on a four-layer model,
comprising the application, transport, network, and link layers. The
file transfer protocol is part of the application layer and helps move
files between local and remote systems. For instance, when
downloading a file via an online service, FTP helps fetch the file from
the remote server where it is hosted, verify the downloader’s
credentials, and transfer the file to the local device where it will now
be available offline.
FTP is built on a client–server
model architecture using separate
control and data connections
between the client and the server.
FTP users may authenticate
themselves with a clear-text sign-in
protocol, normally in the form of a
username and password, but can
connect anonymously if the server
is configured to allow it.
Advantages of FTP:
• Speed: One of the biggest advantages of FTP is speed. The FTP is one of the
fastest way to transfer the files from one computer to another computer.
• Efficient: It is more efficient as we do not need to complete all the
operations to get the entire file.
• Security: To access the FTP server, we need to login with the username and
password. Therefore, we can say that FTP is more secure.
• Back & forth movement: FTP allows us to transfer the files back and forth.
Suppose you are a manager of the company, you send some information to
all the employees, and they all send information back on the same server.
Simple Mail Transfer Protocol (SMTP)
• Email is emerging as one of the most valuable services on the internet today.
Most internet systems use SMTP as a method to transfer mail from one user
to another. SMTP is a push protocol and is used to send the mail whereas
POP (post office protocol) or IMAP (internet message access protocol) are
used to retrieve those emails at the receiver’s side.
• SMTP is an application layer protocol. The client who wants to send the mail
opens a TCP connection to the SMTP server and then sends the mail across
the connection. The SMTP server is an always-on listening mode. As soon as
it listens for a TCP connection from any client, the SMTP process initiates a
connection through port 25. After successfully establishing a TCP connection
the client process sends the mail instantly.
• SMTP server
• Like all servers, an SMTP server is an application that provides a service to other
applications within a network, called clients. Specifically, an SMTP server handles the
sending, receiving, and relaying of email.
• How SMTP works
• Once an SMTP server is established, email clients can connect to and communicate
with it. When the user hits “send” on an email message, the email client opens an
SMTP connection to the server so it can send. (The SMTP connection is built on
something called a TCP connection, which stands for Transmission Control Protocol.)
• From there, the SMTP client uses commands to tell the server what to do and transfer
data, like the sender’s email address, the recipient’s email address, and the email’s
content. The Mail Transfer Agent or Message Transfer Agent (MTA) checks to see if both
email addresses are from the same email domain, such as gmail.com:
• If they are, it sends the email right away
• If not, the server uses the Domain Name System (DNS) to identify the recipient’s domain and then
send it to the right server.
HTTP
• The Hypertext Transfer Protocol (HTTP) is the foundation of the World
Wide Web, and is used to load webpages using hypertext links. HTTP
is an application layer protocol designed to transfer information
between networked devices and runs on top of other layers of the
network protocol stack. A typical flow over HTTP involves a client
machine making a request to a server, which then sends a response
message.
What is in an HTTP request?
• An HTTP request is the way Internet communications platforms such as web
browsers ask for the information they need to load a website.
• Each HTTP request made across the Internet carries with it a series of
encoded data that carries different types of information. A typical HTTP
request contains:
• HTTP version type
• a URL
• an HTTP method (GET , POST)
• HTTP request headers
• HTTP headers contain text information stored in key-value pairs, and they are included in every
HTTP request . These headers communicate core information, such as what browser the client is
using and what data is being requested.
• Optional HTTP body.
• The body of a request is the part that contains the ‘body’ of information the request is transferring.
The body of an HTTP request contains any information being submitted to the web server, such as a
username and password, or any other data entered into a form.
What is in an HTTP response?
• An HTTP response is what web clients (often browsers) receive from an Internet
server in answer to an HTTP request. These responses communicate valuable
information based on what was asked for in the HTTP request.
• A typical HTTP response contains:
• an HTTP status code
• HTTP status codes are 3-digit codes most often used to indicate whether an HTTP request has
been successfully completed. Status codes are broken into the following 5 blocks:
• 1xx Informational
• 2xx Success (200 OK )
• 3xx Redirection
• 4xx Client Error(404 not found)
• 5xx Server Error
• HTTP response headers
• Much like an HTTP request, an HTTP response comes with headers that convey important
information such as the language and format of the data being sent in the response body.
• optional HTTP body
• Successful HTTP responses to ‘GET’ requests generally have a body which contains the
requested information. In most web requests, this is HTML data that a web browser will
translate into a webpage.
POP
• The Post Office Protocol provides access via an Internet Protocol (IP) network
for a user client application to a mailbox (maildrop) maintained on a mail
server. The protocol supports download and delete operations for messages.
POP3 clients connect, retrieve all messages, store them on the client computer,
and finally delete them from the server. This design of POP and its procedures
was driven by the need of users having only temporary Internet connections,
such as dial-up access, allowing these users to retrieve e-mail when connected,
and subsequently to view and manipulate the retrieved messages when
offline.
How does Post Office Protocol Work?
• When a user checks for new email, the client will connect to the POP3 server. The
email client then supplies its username and password to the server for
authentication. Once connected, the client issues a series of text-based commands
to retrieve all email messages. It then stores these downloaded messages on the
user’s local system as new emails, deletes the server copies and disconnects from
the server.
• By default, the server emails are deleted once they are retrieved. As a result, the
emails are tied to that particular machine and it would not be possible to access the
same emails from an email client on another machine. The user could get around
this issue by configuring the email client settings to leave a copy of the emails on
the server.
• POP frees up mailbox space on the server because emails and attachments are
downloaded and deleted at server-end whenever the email client checks for new
mails. Offline email messages stored in the user’s computer do not have mailbox
size limitations except for the hard drive storage capacity of the PC. One drawback
of POP3 mail accounts is that it is difficult for the user to export mails if they decide
to switch email programs or computer systems.
• Advantages of POP3
• Emails are downloaded to the user’s computer. Messages can be read when user is
offline.
• Opening attachments is quick and easy as they are already downloaded.
• Less server storage space required; all emails are stored on local machine.
• Storage capacity of emails limited by the size of your hard disk.
• Very popular, easy to configure and use.
• Disadvantages of POP3
• Emails cannot be accessed from other machines (unless configured to do so).
• Exporting the local mail folder to another email client or physical machine can be
difficult.
• Email folders can become corrupted, potentially losing the entire mailbox at once.
• Email attachments may contain viruses which may expose the user’s PC to harm if
they are opened locally and their virus scanner is unable to detect them.