SlideShare a Scribd company logo
1 of 52
Network Protocols
Abiud Orina
What is a protocol? 🤔
⬥ A protocol is a set of rules that govern all
aspects of communication between two or more
partners, called peers.
⬥ These rules are human-made
2
What is a protocol?
⬥ These rules regulate the following characteristics of a
network:
a. Access method
b. Allowed physical topologies*
c. Types of cabling
d. Speed of data transfer
* Network topology is the arrangement of the elements of a network
3
What is the purpose of protocols?
⬥ They allow connected devices to communicate
with each other, regardless of any differences in
their internal processes, structure or design.
4
Who makes protocols?
⬥ Standardization committees
⬥ Designers of a new distributed application
5
What are the common types of protocols?
1. Transmission Control Protocol (TCP)
2. User Datagram Protocol (UDP)
3. Internet Control Message Protocol (ICMP)
4. Hypertext Transfer Protocol (HTTP)
6
1. Transmission Control Protocol (TCP)
⬥ TCP is a connection-oriented protocol, which
means a connection is established and
maintained until the application programs at
each end have finished exchanging messages.
7
What is TCP used for?
⬥ TCP is used for organizing data in a way that
ensures the secure transmission between the
server and client
8
What is TCP used for?...
⬥ It is used to transmit data from other higher-level
protocols that require all transmitted data to arrive
for example:
⬥ SSH – another network protocol that gives users,
particularly system administrators, a secure way to
access a computer over an unsecured network.
⬥ SMTP (Simple Mail Transfer Protocol) - used in sending
and receiving e-mail
⬥ HTTP (we will talk about this in a moment)
9
Why is TCP important?
⬥ Ensures that data transmission is carried out
uniformly, regardless of the location, hardware or
software involved
⬥ it is flexible and highly scalable (new protocols can be
introduced to it and it will accommodate them)
⬥ It is nonproprietary - no one person or company owns
it.
10
How does TCP work? (Connection establishment)
1. The client sends a SYN packet or segment (SYN stands for
synchronize) with a unique, random number to the server.
This number ensures full transmission in the correct order
(without duplicates).
2. 2. If the server has received the segment, it agrees to the
connection by returning a SYN-ACK packet (ACK stands for
acknowledgment) including the client's sequence number
plus 1. It also transmits its own sequence number to the
client.
11
How does TCP work?...
1. Finally, the client acknowledges the receipt of the SYN-
ACK segment by sending its own ACK packet, which in this
case contains the server's sequence number plus 1. At the
same time, the client can already begin transferring data
to the server.
12
How does TCP work?...
13
How does TCP work?... (Connection termination)
1. The client sends a FIN segment to notify the server that it
no longer wants to send data. It sends its own sequence
number, just as it does when the connection is established.
2. The server acknowledges receipt of the package with an
ACK segment that contains the sequence number plus 1.
3. When the server has finished the data transfer, it also
sends a FIN packet, to which it adds its sequence number.
4. Now the client sends an ACK packet including the
sequence number plus 1, which officially terminates the
TCP connection for the server. 14
How does TCP work?... (Connection termination)
15
2. User Datagram Protocol (UDP)
It is a communications protocol that is primarily used for
establishing low-latency and loss-tolerating connections
between applications on the internet
It speeds up transmissions by enabling the transfer of data
before an agreement is provided by the receiving party
16
What are the differences between UDP and
TCP?
17
What are the differences between UDP and
TCP?
18
How can UDP be used in a DDoS attack?
19
Since UDP does not require a handshake, attackers can ‘flood’
a targeted server with UDP traffic without first getting that
server’s permission to begin communication.
This forces the target to respond with an equally large number
of ICMP (we will talk about these next) packets, which indicate
those ports were unreachable. The computing resources
required to respond to each fraudulent datagram can exhaust
the target, resulting in a denial-of-service to legitimate traffic.
3. Internet Control Message Protocol (ICMP)
20
⬥ It is an error-reporting protocol network that devices like
routers use to generate error messages to the source IP
address when network problems prevent delivery of IP
packets.
⬥ ICMP is mainly used to determine whether or not data is
reaching its intended destination in a timely manner.
What is ICMP used for?
21
1. Error reporting
When two devices connect over the Internet, the ICMP
generates errors to share with the sending device in the event
that any of the data did not get to its intended destination.
For example, if a packet of data is too large for a router, the
router will drop the packet and send an ICMP message back to
the original source for the data.
What is ICMP used for?
22
2. Network diagnostics
⬥ The commonly used terminal utilities traceroute and ping
both operate using ICMP.
⬥ Traceroute – It is used to display the routing path between
two Internet devices. A traceroute reports the time
required for each hop along the way, useful for
determining sources of network delay.
⬥ Ping - A ping will test the speed of the connection
between two devices and report exactly how long it takes a
packet of data to reach its destination
How does ICMP work?
23
⬥ ICMP is not associated with a transport layer protocol such
as TCP or UDP.
⬥ This makes ICMP a connectionless protocol ( one device
does not need to open a connection with another device
before sending an ICMP message.)
Interlude? 🤔
24
Let’s take reactions before proceeding to HTTP
4. Hypertext Transfer Protocol (HTTP)
25
⬥ Is used to load web pages using hypertext links.
⬥ HTTP is an application layer protocol designed to transfer
information between networked devices
⬥ A typical flow over HTTP involves a client(machine) making
a request to a server, which then sends a response
message.
⬥ What are the examples in Be.Well?
What’s in an HTTP request?
26
⬥ An HTTP request is a way internet communications
platforms such as web browsers ask for the information
they need to load a website
⬥ Each HTTP request carries a series of encoded data that
carries different types of information. A typical HTTP
request contains:
⬦ HTTP version type, a URL, an HTTP method, HTTP
request headers and an optional HTTP body.
What is an HTTP method? 🤔
27
An HTTP method indicates the action that the HTTP request
expects from the queried server e.g POST, GET, PUT, PATCH…
Question: What is the difference between PUT and PATCH?*
*A front end dev should answer this first… then a backend dev to blow us
away with knowledge
What are HTTP request headers?
28
⬥ HTTP headers contain text information stored in key-value
pairs
⬥ They are included in every HTTP request and response
⬥ These headers communicate core information, such as
what browser the client is using what data is being
requested, etc.
Open Google Search in chrome and inspect
What’s in an HTTP request body?
29
⬥ 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.
⬥ Open our Be.Well Pro Readme and inspect
Evolution of HTTP
30
HTTP has four versions
1. HTTP/0.9
2. HTTP/1.0
3. HTTP/1.1
4. HTTP/2.0.
Today the version in common use is HTTP/1.1 and the future
will be HTTP/2.0.
1. HTTP/0.9 — The One-line Protocol
31
⬥ The initial version of HTTP — a simple client-server, request-
response, telenet-friendly protocol
⬥ Request nature: single-line (method + path for requested
document)
⬥ Methods supported: GET only
⬥ Response type: hypertext only
⬥ Connection nature: terminated immediately after the
response
⬥ No HTTP headers (cannot transfer other content type files),
No status/error codes, No URLs, No versioning
1. HTTP/0.9 —(Hypertext structure)...
32
2. HTTP/1.0 — Building extensibility
33
⬥ Browser-friendly protocol
⬥ Provided header fields including rich metadata about both
request and response (HTTP version number, status code,
content type, etc.)
⬥ Response: not limited to hypertext (Content-Type header
provided ability to transmit files other than plain HTML files
— e.g. scripts, stylesheets, media)
⬥ Methods supported: GET, HEAD, POST
⬥ Connection nature: terminated immediately after the
response
What was the problem with HTTP/0.9 and HTTP/1.0?
34
⬥ Both HTTP/0.9 and HTTP/1.0 required to open up a new
connection for each request (and close it immediately
after the response was sent).
⬥ Each time a new connection establishes, a TCP three-way
handshake should also occur.
⬥ For better performance, it was crucial to reduce these
round-trips between client and server.
Enter HTTP/1.1, which solved this with persistent connections.
3. HTTP/1.1 — The standardized protocol
35
Introduced critical performance optimizations and feature
enhancements such as:
⬥ persistent and pipelined connections => faster response
⬥ chunked transfers by compression/decompression
⬥ virtual hosting (a server with a single IP Address hosting
multiple domains)
⬥ great bandwidth savings by adding cache support.
Methods supported: GET, HEAD, POST, PUT, DELETE, TRACE,
OPTIONS
Connection nature: long-lived
4. HTTPS
36
⬥ HyperText Transfer Protocol Secure (HTTPS) is the secure
version of HTTP.
⬥ It uses SSL/TLS for secure encrypted communications.
⬥ An HTTPS connection can protect the data transfer from:
a. Man-in-the-middle attacks and
b. Common security threats by providing bidirectional
encryption for communications between a client and
server.
What is the problem with HTTPS?
37
⬥ It normally costs 1–2 seconds and drastically slows down
the startup performance of a website.
⬥ This is because of the time taken to establish the SSL/TLS
handshake process for secure connections
5. HTTP/2.0 and the future
38
⬥ Modern enhancements like HTTP/2.0, Server Side Events
(SSE), and Websockets have changed the way that the
traditional HTTP works
What is HTTP polling?
39
⬥ HTTP polling is a method where the client polls the server
requesting new information
What are the methods of HTTP polling?
40
1. HTTP Short Polling
2. HTTP Long Polling
3. HTTP Periodic Polling
4. HTTP Streaming
5. SSE (Server-Sent Events / EventSource)
6. HTTP/2 Server Push
7. WebSockets
1. HTTP Short Polling
41
⬥ A lot of requests are processed as they come to the server,
creating a lot of traffic
⬥ Uses resources, but frees them as soon as the response is
sent back
Problem: Its bad if you need to be notified WHEN the server
event happens with no delay
2. HTTP Long Polling
42
⬥ One request goes to the server and the client is waiting for
the response to come. The server holds the request open
until new data is available (it’s unresolved and resources
are blocked)
Problem: It is more complex and more server resources used
3. HTTP Periodic Polling
43
⬥ There’s a predefined time gap between two requests.
⬥ This is an improved/managed version of polling. You can
reduce server consumption by increasing the time gap
between two requests
4. HTTP Streaming
44
⬥ The client makes an HTTP request, and the server trickles
out a response of indefinite length (it’s like polling
infinitely)
Problem: Intermediaries can interrupt the connection (e.g.
timeouts)
5. SSE (Server-Sent Events / EventSource)
45
⬥ Communication is carried out from server to browser only
⬥ Browsers can only subscribe to data updates originated by
the server, but cannot send any data to the server
Sample applications: Updates when the test results are ready
in Be.Well
6. HTTP/2 Server Push
46
⬥ a server to proactively push assets (stylesheets, scripts,
media) to the client cache in advance
Sample applications: Social media feeds, single-page apps
Sample applications: Updates when the test results are ready
in Be.Well
6. HTTP/2 Server Push… Problems
47
⬥ Intermediaries (proxies, routers, hosts) can choose not to
properly push information to the client as intended by the
origin server.
⬥ Connections aren’t kept open indefinitely. A connection
can be closed anytime even when the content pushing
process happens. Once closed and opened again, this
connection cannot continue from where it left.
⬥ Some browsers/intermediaries don’t support Server Push
7. WebSockets
48
⬥ WebSockets allow both the server and the client to push
messages at any time without any relation to a previous
request
“Websockets take polling out of the equation”
49
WebSockets solve a few issues with HTTP:
50
⬥ Bi-directional protocol — either client/server can send a
message to the other party. HTTP is a unidirectional
protocol
⬥ Full-duplex communication — client and server can talk to
each other independently at the same time.
⬥ Single TCP connection — After upgrading the HTTP
connection, in the beginning, the client and server
communicate over that same TCP connection throughout
the lifecycle of WebSocket connection.
References
51
1. Evolution of HTTP
2. What is ICMP?
3. What is HTTP?
4. What is a DDoS attack?
5. Definition of ICMP by Search Networking
6. PUT vs PATCH (What's the Difference?)
THANKS!
ANY QUESTIONS?
52

More Related Content

What's hot

Subnetting Presentation
Subnetting PresentationSubnetting Presentation
Subnetting Presentation
Touhidul Fahim
 

What's hot (20)

HTTP & WWW
HTTP & WWWHTTP & WWW
HTTP & WWW
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
 
Tcp/ip
Tcp/ipTcp/ip
Tcp/ip
 
Subnetting Presentation
Subnetting PresentationSubnetting Presentation
Subnetting Presentation
 
Chapter1 computer introduction note
Chapter1  computer introduction note Chapter1  computer introduction note
Chapter1 computer introduction note
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
Tcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication headerTcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication header
 
Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
 
Address resolution protocol (ARP)
Address resolution protocol (ARP)Address resolution protocol (ARP)
Address resolution protocol (ARP)
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
 
TCP and UDP
TCP and UDP TCP and UDP
TCP and UDP
 
Computer Networking.
Computer Networking.Computer Networking.
Computer Networking.
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
Types of Network Architecture
Types of Network ArchitectureTypes of Network Architecture
Types of Network Architecture
 
TCP/IP – Transmission Control Protocol/ Internet Protocol
TCP/IP – Transmission Control Protocol/ Internet ProtocolTCP/IP – Transmission Control Protocol/ Internet Protocol
TCP/IP – Transmission Control Protocol/ Internet Protocol
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing
 
Ip address presentation
Ip address presentationIp address presentation
Ip address presentation
 
DHCP
DHCPDHCP
DHCP
 
Routers.ppt
Routers.pptRouters.ppt
Routers.ppt
 
TCP IP Model | Computer Science
TCP IP Model | Computer ScienceTCP IP Model | Computer Science
TCP IP Model | Computer Science
 

Similar to Network protocols

Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...
smitha273566
 
Notes e commerce
Notes e commerceNotes e commerce
Notes e commerce
S S
 

Similar to Network protocols (20)

Unit 4 tansport layer in the internat
Unit 4 tansport layer in the internatUnit 4 tansport layer in the internat
Unit 4 tansport layer in the internat
 
presentation on TCP/IP protocols data comunications
presentation on TCP/IP protocols data comunicationspresentation on TCP/IP protocols data comunications
presentation on TCP/IP protocols data comunications
 
Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...
 
uniti-websitebasics-230517110223-12e31dbc (1).pptx
uniti-websitebasics-230517110223-12e31dbc (1).pptxuniti-websitebasics-230517110223-12e31dbc (1).pptx
uniti-websitebasics-230517110223-12e31dbc (1).pptx
 
Protocols in computer network
Protocols in computer network   Protocols in computer network
Protocols in computer network
 
Module 1 slides
Module 1 slidesModule 1 slides
Module 1 slides
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
IT2255 Web Essentials - Unit I Website Basics
IT2255 Web Essentials - Unit I  Website BasicsIT2255 Web Essentials - Unit I  Website Basics
IT2255 Web Essentials - Unit I Website Basics
 
Unit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptxUnit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptx
 
Unit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptxUnit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptx
 
Transport layer
Transport layerTransport layer
Transport layer
 
TCP/IP & UDP
TCP/IP & UDPTCP/IP & UDP
TCP/IP & UDP
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- final
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
Hyper Text Transfer Protocol
Hyper Text Transfer ProtocolHyper Text Transfer Protocol
Hyper Text Transfer Protocol
 
Chapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxChapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptx
 
Mcse question
Mcse questionMcse question
Mcse question
 
Week10 transport
Week10 transportWeek10 transport
Week10 transport
 
TRANSPORT LAYER ppt.pptx
TRANSPORT LAYER ppt.pptxTRANSPORT LAYER ppt.pptx
TRANSPORT LAYER ppt.pptx
 
Notes e commerce
Notes e commerceNotes e commerce
Notes e commerce
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Network protocols

  • 2. What is a protocol? 🤔 ⬥ A protocol is a set of rules that govern all aspects of communication between two or more partners, called peers. ⬥ These rules are human-made 2
  • 3. What is a protocol? ⬥ These rules regulate the following characteristics of a network: a. Access method b. Allowed physical topologies* c. Types of cabling d. Speed of data transfer * Network topology is the arrangement of the elements of a network 3
  • 4. What is the purpose of protocols? ⬥ They allow connected devices to communicate with each other, regardless of any differences in their internal processes, structure or design. 4
  • 5. Who makes protocols? ⬥ Standardization committees ⬥ Designers of a new distributed application 5
  • 6. What are the common types of protocols? 1. Transmission Control Protocol (TCP) 2. User Datagram Protocol (UDP) 3. Internet Control Message Protocol (ICMP) 4. Hypertext Transfer Protocol (HTTP) 6
  • 7. 1. Transmission Control Protocol (TCP) ⬥ TCP is a connection-oriented protocol, which means a connection is established and maintained until the application programs at each end have finished exchanging messages. 7
  • 8. What is TCP used for? ⬥ TCP is used for organizing data in a way that ensures the secure transmission between the server and client 8
  • 9. What is TCP used for?... ⬥ It is used to transmit data from other higher-level protocols that require all transmitted data to arrive for example: ⬥ SSH – another network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network. ⬥ SMTP (Simple Mail Transfer Protocol) - used in sending and receiving e-mail ⬥ HTTP (we will talk about this in a moment) 9
  • 10. Why is TCP important? ⬥ Ensures that data transmission is carried out uniformly, regardless of the location, hardware or software involved ⬥ it is flexible and highly scalable (new protocols can be introduced to it and it will accommodate them) ⬥ It is nonproprietary - no one person or company owns it. 10
  • 11. How does TCP work? (Connection establishment) 1. The client sends a SYN packet or segment (SYN stands for synchronize) with a unique, random number to the server. This number ensures full transmission in the correct order (without duplicates). 2. 2. If the server has received the segment, it agrees to the connection by returning a SYN-ACK packet (ACK stands for acknowledgment) including the client's sequence number plus 1. It also transmits its own sequence number to the client. 11
  • 12. How does TCP work?... 1. Finally, the client acknowledges the receipt of the SYN- ACK segment by sending its own ACK packet, which in this case contains the server's sequence number plus 1. At the same time, the client can already begin transferring data to the server. 12
  • 13. How does TCP work?... 13
  • 14. How does TCP work?... (Connection termination) 1. The client sends a FIN segment to notify the server that it no longer wants to send data. It sends its own sequence number, just as it does when the connection is established. 2. The server acknowledges receipt of the package with an ACK segment that contains the sequence number plus 1. 3. When the server has finished the data transfer, it also sends a FIN packet, to which it adds its sequence number. 4. Now the client sends an ACK packet including the sequence number plus 1, which officially terminates the TCP connection for the server. 14
  • 15. How does TCP work?... (Connection termination) 15
  • 16. 2. User Datagram Protocol (UDP) It is a communications protocol that is primarily used for establishing low-latency and loss-tolerating connections between applications on the internet It speeds up transmissions by enabling the transfer of data before an agreement is provided by the receiving party 16
  • 17. What are the differences between UDP and TCP? 17
  • 18. What are the differences between UDP and TCP? 18
  • 19. How can UDP be used in a DDoS attack? 19 Since UDP does not require a handshake, attackers can ‘flood’ a targeted server with UDP traffic without first getting that server’s permission to begin communication. This forces the target to respond with an equally large number of ICMP (we will talk about these next) packets, which indicate those ports were unreachable. The computing resources required to respond to each fraudulent datagram can exhaust the target, resulting in a denial-of-service to legitimate traffic.
  • 20. 3. Internet Control Message Protocol (ICMP) 20 ⬥ It is an error-reporting protocol network that devices like routers use to generate error messages to the source IP address when network problems prevent delivery of IP packets. ⬥ ICMP is mainly used to determine whether or not data is reaching its intended destination in a timely manner.
  • 21. What is ICMP used for? 21 1. Error reporting When two devices connect over the Internet, the ICMP generates errors to share with the sending device in the event that any of the data did not get to its intended destination. For example, if a packet of data is too large for a router, the router will drop the packet and send an ICMP message back to the original source for the data.
  • 22. What is ICMP used for? 22 2. Network diagnostics ⬥ The commonly used terminal utilities traceroute and ping both operate using ICMP. ⬥ Traceroute – It is used to display the routing path between two Internet devices. A traceroute reports the time required for each hop along the way, useful for determining sources of network delay. ⬥ Ping - A ping will test the speed of the connection between two devices and report exactly how long it takes a packet of data to reach its destination
  • 23. How does ICMP work? 23 ⬥ ICMP is not associated with a transport layer protocol such as TCP or UDP. ⬥ This makes ICMP a connectionless protocol ( one device does not need to open a connection with another device before sending an ICMP message.)
  • 24. Interlude? 🤔 24 Let’s take reactions before proceeding to HTTP
  • 25. 4. Hypertext Transfer Protocol (HTTP) 25 ⬥ Is used to load web pages using hypertext links. ⬥ HTTP is an application layer protocol designed to transfer information between networked devices ⬥ A typical flow over HTTP involves a client(machine) making a request to a server, which then sends a response message. ⬥ What are the examples in Be.Well?
  • 26. What’s in an HTTP request? 26 ⬥ An HTTP request is a way internet communications platforms such as web browsers ask for the information they need to load a website ⬥ Each HTTP request carries a series of encoded data that carries different types of information. A typical HTTP request contains: ⬦ HTTP version type, a URL, an HTTP method, HTTP request headers and an optional HTTP body.
  • 27. What is an HTTP method? 🤔 27 An HTTP method indicates the action that the HTTP request expects from the queried server e.g POST, GET, PUT, PATCH… Question: What is the difference between PUT and PATCH?* *A front end dev should answer this first… then a backend dev to blow us away with knowledge
  • 28. What are HTTP request headers? 28 ⬥ HTTP headers contain text information stored in key-value pairs ⬥ They are included in every HTTP request and response ⬥ These headers communicate core information, such as what browser the client is using what data is being requested, etc. Open Google Search in chrome and inspect
  • 29. What’s in an HTTP request body? 29 ⬥ 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. ⬥ Open our Be.Well Pro Readme and inspect
  • 30. Evolution of HTTP 30 HTTP has four versions 1. HTTP/0.9 2. HTTP/1.0 3. HTTP/1.1 4. HTTP/2.0. Today the version in common use is HTTP/1.1 and the future will be HTTP/2.0.
  • 31. 1. HTTP/0.9 — The One-line Protocol 31 ⬥ The initial version of HTTP — a simple client-server, request- response, telenet-friendly protocol ⬥ Request nature: single-line (method + path for requested document) ⬥ Methods supported: GET only ⬥ Response type: hypertext only ⬥ Connection nature: terminated immediately after the response ⬥ No HTTP headers (cannot transfer other content type files), No status/error codes, No URLs, No versioning
  • 32. 1. HTTP/0.9 —(Hypertext structure)... 32
  • 33. 2. HTTP/1.0 — Building extensibility 33 ⬥ Browser-friendly protocol ⬥ Provided header fields including rich metadata about both request and response (HTTP version number, status code, content type, etc.) ⬥ Response: not limited to hypertext (Content-Type header provided ability to transmit files other than plain HTML files — e.g. scripts, stylesheets, media) ⬥ Methods supported: GET, HEAD, POST ⬥ Connection nature: terminated immediately after the response
  • 34. What was the problem with HTTP/0.9 and HTTP/1.0? 34 ⬥ Both HTTP/0.9 and HTTP/1.0 required to open up a new connection for each request (and close it immediately after the response was sent). ⬥ Each time a new connection establishes, a TCP three-way handshake should also occur. ⬥ For better performance, it was crucial to reduce these round-trips between client and server. Enter HTTP/1.1, which solved this with persistent connections.
  • 35. 3. HTTP/1.1 — The standardized protocol 35 Introduced critical performance optimizations and feature enhancements such as: ⬥ persistent and pipelined connections => faster response ⬥ chunked transfers by compression/decompression ⬥ virtual hosting (a server with a single IP Address hosting multiple domains) ⬥ great bandwidth savings by adding cache support. Methods supported: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS Connection nature: long-lived
  • 36. 4. HTTPS 36 ⬥ HyperText Transfer Protocol Secure (HTTPS) is the secure version of HTTP. ⬥ It uses SSL/TLS for secure encrypted communications. ⬥ An HTTPS connection can protect the data transfer from: a. Man-in-the-middle attacks and b. Common security threats by providing bidirectional encryption for communications between a client and server.
  • 37. What is the problem with HTTPS? 37 ⬥ It normally costs 1–2 seconds and drastically slows down the startup performance of a website. ⬥ This is because of the time taken to establish the SSL/TLS handshake process for secure connections
  • 38. 5. HTTP/2.0 and the future 38 ⬥ Modern enhancements like HTTP/2.0, Server Side Events (SSE), and Websockets have changed the way that the traditional HTTP works
  • 39. What is HTTP polling? 39 ⬥ HTTP polling is a method where the client polls the server requesting new information
  • 40. What are the methods of HTTP polling? 40 1. HTTP Short Polling 2. HTTP Long Polling 3. HTTP Periodic Polling 4. HTTP Streaming 5. SSE (Server-Sent Events / EventSource) 6. HTTP/2 Server Push 7. WebSockets
  • 41. 1. HTTP Short Polling 41 ⬥ A lot of requests are processed as they come to the server, creating a lot of traffic ⬥ Uses resources, but frees them as soon as the response is sent back Problem: Its bad if you need to be notified WHEN the server event happens with no delay
  • 42. 2. HTTP Long Polling 42 ⬥ One request goes to the server and the client is waiting for the response to come. The server holds the request open until new data is available (it’s unresolved and resources are blocked) Problem: It is more complex and more server resources used
  • 43. 3. HTTP Periodic Polling 43 ⬥ There’s a predefined time gap between two requests. ⬥ This is an improved/managed version of polling. You can reduce server consumption by increasing the time gap between two requests
  • 44. 4. HTTP Streaming 44 ⬥ The client makes an HTTP request, and the server trickles out a response of indefinite length (it’s like polling infinitely) Problem: Intermediaries can interrupt the connection (e.g. timeouts)
  • 45. 5. SSE (Server-Sent Events / EventSource) 45 ⬥ Communication is carried out from server to browser only ⬥ Browsers can only subscribe to data updates originated by the server, but cannot send any data to the server Sample applications: Updates when the test results are ready in Be.Well
  • 46. 6. HTTP/2 Server Push 46 ⬥ a server to proactively push assets (stylesheets, scripts, media) to the client cache in advance Sample applications: Social media feeds, single-page apps Sample applications: Updates when the test results are ready in Be.Well
  • 47. 6. HTTP/2 Server Push… Problems 47 ⬥ Intermediaries (proxies, routers, hosts) can choose not to properly push information to the client as intended by the origin server. ⬥ Connections aren’t kept open indefinitely. A connection can be closed anytime even when the content pushing process happens. Once closed and opened again, this connection cannot continue from where it left. ⬥ Some browsers/intermediaries don’t support Server Push
  • 48. 7. WebSockets 48 ⬥ WebSockets allow both the server and the client to push messages at any time without any relation to a previous request “Websockets take polling out of the equation”
  • 49. 49
  • 50. WebSockets solve a few issues with HTTP: 50 ⬥ Bi-directional protocol — either client/server can send a message to the other party. HTTP is a unidirectional protocol ⬥ Full-duplex communication — client and server can talk to each other independently at the same time. ⬥ Single TCP connection — After upgrading the HTTP connection, in the beginning, the client and server communicate over that same TCP connection throughout the lifecycle of WebSocket connection.
  • 51. References 51 1. Evolution of HTTP 2. What is ICMP? 3. What is HTTP? 4. What is a DDoS attack? 5. Definition of ICMP by Search Networking 6. PUT vs PATCH (What's the Difference?)