0% found this document useful (0 votes)
22 views30 pages

Protocal S

Uploaded by

Sajan Basnet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views30 pages

Protocal S

Uploaded by

Sajan Basnet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Introduction to Protocols

Unit 5(sub part)


Network Protocols
• In networking, a protocol is a set of rules for formatting and processing
data. Network protocols are like a common language for computers. The
computers within a network may use vastly different software and
hardware; however, the use of protocols enables them to communicate
with each other regardless.
• Standardized protocols are like a common language that computers can
use, similar to how two people from different parts of the world may not
understand each other's native languages, but they can communicate using
a shared third language. If one computer uses the Internet Protocol (IP) and
a second computer does as well, they will be able to communicate . But if
one computer uses IP and the other does not know this protocol, they will
be unable to communicate.
Cont..
• The Open Systems Interconnection (OSI)
model is an abstract representation of how
the Internet works. It contains 7 layers, with
each layer representing a different category of
networking functions.
• Protocols make these networking functions
possible. For instance, the Internet Protocol
(IP) is responsible for routing data by
indicating where data packets* come from and
what their destination is. IP makes network-to-
network communications possible. Hence, IP
is considered a network layer (layer 3)
protocol.
• As another example, the Transmission Control
Protocol (TCP) ensures that the transportation
of packets of data across networks goes
smoothly. Therefore, TCP is considered a
transport layer (layer 4) protocol.
Example of some popular Network Protocols
are:
• Point to Point Protocol(PPP)
• Internet Protocol (IP)
• Transmission Control Protocol(TCP)
• File Transmission Protocol(FTP)
• Simple Mail Transfer Protocol(SMTP)
• HTTP
• POP
Point to Point Protocol(PPP)
• Point-to-point protocol (PPP) is a computer network
protocol used to transfer a datagram between two directly
connected (point-to-point) computers. This protocol is used
for a very basic level of connectivity providing data linkage
between the computers. Point-to-point protocol is widely
used for the heavier and faster connections necessary for
broadband communications.
• Point-to-point protocol is also known as RFC 1661.
• There are many physical mediums for point-to-point
connectivity, such as simple serial cables, mobile phones
and telephone lines.
Cont..
• For Ethernet networks, TCP and IP were introduced for data
communication purposes. Both of these protocols have
specifications for Ethernet networks only. Thus, TCP and IP do not
support point-to-point connections. Therefore, PPP was
introduced for point-to-point connectivity without Ethernet.
• When two computers are being connected directly, both ends
send a request for configuration. Once the computers are
connected, PPP handles link control, data control and protocol
encapsulation.
PPP Frame
• PPP is a byte - oriented protocol where each field of the frame is composed
of one or more bytes. The fields of a PPP frame are −
• Flag − 1 byte that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
• Address − 1 byte which is set to 11111111 in case of broadcast.
• Control − 1 byte set to a constant value of 11000000.
• Protocol − 1 or 2 bytes that define the type of data contained in the
payload field.
• Payload − This carries the data from the network layer. The maximum
length of the payload field is 1500 bytes. However, this may be negotiated
between the endpoints of communication.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)
Internet Protocol (IP)
• The Internet Protocol (IP) is a protocol, or set of rules, for routing and
addressing packets of data so that they can travel across networks and arrive
at the correct destination. Data traversing the Internet is divided into smaller
pieces, called packets. IP information is attached to each packet, and this
information helps routers to send packets to the right place. Every device or
domain that connects to the Internet is assigned an IP address, and as
packets are directed to the IP address attached to them, data arrives where it
is needed.
• Once the packets arrive at their destination, they are handled differently
depending on which transport protocol is used in combination with IP. The
most common transport protocols are TCP and UDP.
IPv4 Packet Header: Format and Structure
• When computers transmit information from one device to another, they split
the messages into basic communication units, called packets or datagrams.
Then, routers forward these packets along the IP network until they reach the
destination where they are reassembled again.
• Every IPv4 packet has the maximum value of 65,535 bytes and consists of a
header and data. The IP header length can vary: From the minimum length of
20 to a total length of 60 bytes. It includes the source address and destination
address, as well as other fields that help route the packet. The data is the
actual message (information) of variable length.
IPv4 packet header format
• An IP packet envelopes the data unit received from the network layer and adds
it to its header. All the information the header contains helps the datagram to
reach its destination.
• The IPv4 packet header contains a fixed mandatory part, which is made of 13
fields. Let’s take a closer look at the IPv4 header format, the header fields and
the roles each of them has.
Field Length Description
Version 4 bits Specifies the IP protocol version, IPv4 or IPv6.
Header 4 bits Specifies the length of the IPv4 header.
Length
Type of 8 bits Specifies the type of service. This field takes effect only in the
Service (ToS) differentiated service model.
Total Length 16 bits Specifies the length of the header and data.
Identification 16 bits IPv4 software maintains a counter in the storage device to record the
number of IP datagrams. The counter value increases by 1 every time
a datagram is sent, and is filled in the identification field.
Flags 3 bits Only the rightmost two bits are valid. The rightmost bit indicates
whether the datagram is not the last data fragment. The value 1
indicates the last fragment, and the value 0 indicates non-last
fragment. The middle bit is the fragmentation flag. The value 1
indicates that the datagram cannot be fragmented, and the value 0
indicates that the datagram can be fragmented.
Fragment Offset 13 bits Specifies the location of a fragment in a packet.

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.

Source IP Address 32 bits Specifies the IPv4 address of a sender.

Destination IP 32 bits Specifies the IPv4 address of a receiver.


Address

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy