SlideShare a Scribd company logo
 TCP and UDP are used to connect two devices over the
Internet or other networks.
 However, to give data packages an entrance to the PC
or server at the other end of the connection, the
“doors” have to be open.
 These openings into the system are called ports.
 For both protocols, there are some known and
important ports which you need to know when
developing web apps.

 when you send a TCP/IP message over the Internet,
you have to send it to the right port. TCP ports, unlike
entrances ,are referred to by numbers (from 0 to
65535).
 When communicating via the Internet, the two
protocols TCP and UDP establish the connection,
compile data packages again after transfer, and then
hand them over to the programs addressed on the
recipient’s device.
 For this handover to work, the operating system must
create entrances and open them for the transfer.
 Every entrance has a specific code number. After
the transfer, the receiving system knows where the
data has to be delivered based on the port number.
 The data package always includes two port numbers:
the sender’s and the recipient’s.
 Ports have consecutive numbers – from 0 to 65536.
 Some of these code numbers are standardized,
which means they are assigned to specific
applications.
 Ports 0–1023 are “well-known ports”, and only a system
process or an administrator can connect to them.
 Ports 1024–49151 are “registered”, so that common
applications can have a usual port number.
 However, most services are able to bind any port
number in this range.
 The Internet Assigned Numbers Authority (IANA) is
responsible for registering the numbers in these
ranges.
OTHER COMMON PORTS
 Even if you will rarely need a complete catalogue of all port numbers
for services, you can rapidly start to memorize port numbers for the
common services that you use daily. For example, you will very likely
come across the following ports regularly:
 80 HTTP
 8080 HTTP (for testing servers)
 443 HTTPS
 22 SSH (Secure Shell)
 23 Telnet
 25 SMTP (outbound email)
 110 POP3 (inbound email)
 220 IMAP (inbound email)

APPLICATION LAYER PROTOCOLS
 We have seen examples of protocols at the different
layers of the TCP/IP stack, from the low-level
communication across wired Ethernet, the low-level
IP communication, and the TCP transport layer.
 Now we come to the highest layer of the stack, the
application layer. This is the layer you are most likely
to interact with while prototyping an Internet of
Things project.
 A protocol is a set of rules for communication between
computers. It includes rules about how to initiate the
conversation and what format the messages should be
in.
 It determines what inputs are understood and what
output is transmitted.
 It also specifies how the messages are sent and
authenticated and how to handle (and maybe correct)
errors caused by transmission.
 some application layer protocols, starting with
HTTP
 HTTP
 The Internet is much more than just “the web”, but
inevitably web services carried over HTTP hold a large
part of our attention when looking at the Internet of
Things.
 HTTP is, at its core, a simple protocol. The client
requests a resource by sending a command to a URL,
with some headers.
 We use the current version of HTTP, 1.1, in these
examples. Let’s try to get a simple document
 at http://book.roomofthings.com/hello.txt. You can
see the result if you open the URL in your web browser.
 But let’s look at what the browser is actually sending to the
server to do this.The basic structure of the request would
look like this:
 GET /hello.txt HTTP/1.1
 Host: book.roomofthings.com
 Notice how the message is written in plain text, in a
human-readable way (this might sound obvious, but not all
protocols are; the messages could be encoded into bytes in
a binary protocol, for example).
 We specified the GET method because we’re simply getting
the page. We then tell the server which resource we want
(/hello.txt) and what version of the protocol we’re using.
HTTPS: ENCRYPTED HTTP
 We have seen how the request and response are
created in a simple text format. If someone
eavesdropped your connection (easy to do with tools
such as Wireshark if you have access to the network at
either end), that person can easily read the
conversation.
 In fact, it isn’t the format of the protocol that is the
problem: even if the conversation happened in binary,
an attacker could write a tool to translate the format
into something readable.
 Rather, the problem is that the conversation isn’t
encrypted. The HTTPS protocol is actually just a mix-
up of plain old HTTP over the Secure Socket Layer
(SSL) protocol.
 An HTTPS server listens to a different port (usually
443) and on connection sets up a secure, encrypted
connection with the client . When that’s established,
both sides just speak HTTP to each other as before!
 This means that a network snooper can find out only
the IP address and port number of the request
(because both of these are public information in the
envelope of the underlying TCP message, there’s no
way around that).
 After that, all it can see is that packets of data are
being sent in a request and packets are returned for
the response.

More Related Content

What's hot

Tcp and udp
Tcp and udpTcp and udp
Tcp and udp
Ahmad Khalid Nasrat
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
selvakumar_b1985
 
Physical Design of IoT.pdf
Physical Design of IoT.pdfPhysical Design of IoT.pdf
Physical Design of IoT.pdf
JoshuaKimmich1
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
Peter R. Egli
 
Network switch
Network switchNetwork switch
Network switch
Ravinder Kaur
 
TCP/ IP
TCP/ IP TCP/ IP
Business Models_Internet of Things (Part 01)
Business Models_Internet of Things (Part 01)Business Models_Internet of Things (Part 01)
Business Models_Internet of Things (Part 01)
alengadan
 
What is a static ip address
What is a static ip addressWhat is a static ip address
What is a static ip address
Hexa Howe
 
TCP IP Model | Computer Science
TCP IP Model | Computer ScienceTCP IP Model | Computer Science
TCP IP Model | Computer Science
Transweb Global Inc
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
Ankur Kumar
 
Computer networks--networking hardware
Computer networks--networking hardwareComputer networks--networking hardware
Computer networks--networking hardware
Mziaulla
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
Mukesh Tekwani
 
IPV4 Frame Format
IPV4 Frame FormatIPV4 Frame Format
IPV4 Frame Format
Aditya Rawat
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
N.Jagadish Kumar
 
Frame relay
Frame relayFrame relay
Frame relay
Ayesha Maqsood
 
IoT with Python
IoT with PythonIoT with Python
IoT with Python
Dr. Sanjay Shitole
 
TCP/IP 3-way Handshake
TCP/IP 3-way Handshake TCP/IP 3-way Handshake
TCP/IP 3-way Handshake
Alok Tripathi
 
Routers.ppt
Routers.pptRouters.ppt
Routers.ppt
kirbadh
 
UDP - User Datagram Protocol
UDP - User Datagram ProtocolUDP - User Datagram Protocol
UDP - User Datagram Protocol
Peter R. Egli
 

What's hot (20)

Tcp and udp
Tcp and udpTcp and udp
Tcp and udp
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
 
Physical Design of IoT.pdf
Physical Design of IoT.pdfPhysical Design of IoT.pdf
Physical Design of IoT.pdf
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
 
Network switch
Network switchNetwork switch
Network switch
 
TCP/ IP
TCP/ IP TCP/ IP
TCP/ IP
 
Business Models_Internet of Things (Part 01)
Business Models_Internet of Things (Part 01)Business Models_Internet of Things (Part 01)
Business Models_Internet of Things (Part 01)
 
What is a static ip address
What is a static ip addressWhat is a static ip address
What is a static ip address
 
TCP IP Model | Computer Science
TCP IP Model | Computer ScienceTCP IP Model | Computer Science
TCP IP Model | Computer Science
 
Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
 
Udp vs-tcp
Udp vs-tcpUdp vs-tcp
Udp vs-tcp
 
Computer networks--networking hardware
Computer networks--networking hardwareComputer networks--networking hardware
Computer networks--networking hardware
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
IPV4 Frame Format
IPV4 Frame FormatIPV4 Frame Format
IPV4 Frame Format
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
Frame relay
Frame relayFrame relay
Frame relay
 
IoT with Python
IoT with PythonIoT with Python
IoT with Python
 
TCP/IP 3-way Handshake
TCP/IP 3-way Handshake TCP/IP 3-way Handshake
TCP/IP 3-way Handshake
 
Routers.ppt
Routers.pptRouters.ppt
Routers.ppt
 
UDP - User Datagram Protocol
UDP - User Datagram ProtocolUDP - User Datagram Protocol
UDP - User Datagram Protocol
 

Similar to Tcp and udp ports

How does internet works
How does internet worksHow does internet works
How does internet works
RamonNavarro46
 
Protocols in computer network
Protocols in computer network   Protocols in computer network
Protocols in computer network
priya sehgal
 
Tcp Udp Notes
Tcp Udp NotesTcp Udp Notes
Tcp Udp Notes
Ram Dutt Shukla
 
Internetbasics
InternetbasicsInternetbasics
Internetbasicspatinijava
 
Ch4 Protocols.pptx
Ch4 Protocols.pptxCh4 Protocols.pptx
Ch4 Protocols.pptx
kebeAman
 
Ch4 Protocols.pptx
Ch4 Protocols.pptxCh4 Protocols.pptx
Ch4 Protocols.pptx
azmerawAnna1
 
network protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedinetwork protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedi
nitashach22
 
Networking-basics
Networking-basicsNetworking-basics
Networking-basics
Raj Alam
 
internet protocol
internet protocolinternet protocol
internet protocol
rajshreemuthiah
 
HNS L III UC2 Installing and Managing Network Protocols .pdf
HNS L III UC2 Installing and Managing Network Protocols .pdfHNS L III UC2 Installing and Managing Network Protocols .pdf
HNS L III UC2 Installing and Managing Network Protocols .pdf
AbenetAsmellash
 
Application Layer
Application LayerApplication Layer
Application Layer
Sweta Kumari Barnwal
 
How Internet Works
How Internet WorksHow Internet Works
How Internet Works
sumit kumar
 
Http Vs Https .
Http Vs Https . Http Vs Https .
Http Vs Https .
simplyharshad
 
Published on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docxPublished on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docx
amrit47
 
Ajp notes-chapter-04
Ajp notes-chapter-04Ajp notes-chapter-04
Ajp notes-chapter-04
Ankit Dubey
 
An Introduction to HTTP
An Introduction to HTTPAn Introduction to HTTP
An Introduction to HTTP
Keerthana Krishnan
 
Basic to advance protocols
Basic to advance protocolsBasic to advance protocols
Basic to advance protocols
Varinder Singh Walia
 
application layer
application layerapplication layer
application layer
BishalWosti1
 
Network protocols
Network protocolsNetwork protocols
Network protocols
Abiud Orina
 

Similar to Tcp and udp ports (20)

How does internet works
How does internet worksHow does internet works
How does internet works
 
Protocols in computer network
Protocols in computer network   Protocols in computer network
Protocols in computer network
 
Tcp Udp Notes
Tcp Udp NotesTcp Udp Notes
Tcp Udp Notes
 
Internetbasics
InternetbasicsInternetbasics
Internetbasics
 
Ch4 Protocols.pptx
Ch4 Protocols.pptxCh4 Protocols.pptx
Ch4 Protocols.pptx
 
Ch4 Protocols.pptx
Ch4 Protocols.pptxCh4 Protocols.pptx
Ch4 Protocols.pptx
 
network protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedinetwork protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedi
 
Networking infrastructure
Networking infrastructureNetworking infrastructure
Networking infrastructure
 
Networking-basics
Networking-basicsNetworking-basics
Networking-basics
 
internet protocol
internet protocolinternet protocol
internet protocol
 
HNS L III UC2 Installing and Managing Network Protocols .pdf
HNS L III UC2 Installing and Managing Network Protocols .pdfHNS L III UC2 Installing and Managing Network Protocols .pdf
HNS L III UC2 Installing and Managing Network Protocols .pdf
 
Application Layer
Application LayerApplication Layer
Application Layer
 
How Internet Works
How Internet WorksHow Internet Works
How Internet Works
 
Http Vs Https .
Http Vs Https . Http Vs Https .
Http Vs Https .
 
Published on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docxPublished on IST 554 (httpsonline.ist.psu.eduist554).docx
Published on IST 554 (httpsonline.ist.psu.eduist554).docx
 
Ajp notes-chapter-04
Ajp notes-chapter-04Ajp notes-chapter-04
Ajp notes-chapter-04
 
An Introduction to HTTP
An Introduction to HTTPAn Introduction to HTTP
An Introduction to HTTP
 
Basic to advance protocols
Basic to advance protocolsBasic to advance protocols
Basic to advance protocols
 
application layer
application layerapplication layer
application layer
 
Network protocols
Network protocolsNetwork protocols
Network protocols
 

Recently uploaded

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 

Recently uploaded (20)

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 

Tcp and udp ports

  • 1.
  • 2.  TCP and UDP are used to connect two devices over the Internet or other networks.  However, to give data packages an entrance to the PC or server at the other end of the connection, the “doors” have to be open.  These openings into the system are called ports.  For both protocols, there are some known and important ports which you need to know when developing web apps. 
  • 3.  when you send a TCP/IP message over the Internet, you have to send it to the right port. TCP ports, unlike entrances ,are referred to by numbers (from 0 to 65535).  When communicating via the Internet, the two protocols TCP and UDP establish the connection, compile data packages again after transfer, and then hand them over to the programs addressed on the recipient’s device.
  • 4.  For this handover to work, the operating system must create entrances and open them for the transfer.  Every entrance has a specific code number. After the transfer, the receiving system knows where the data has to be delivered based on the port number.  The data package always includes two port numbers: the sender’s and the recipient’s.
  • 5.  Ports have consecutive numbers – from 0 to 65536.  Some of these code numbers are standardized, which means they are assigned to specific applications.  Ports 0–1023 are “well-known ports”, and only a system process or an administrator can connect to them.
  • 6.  Ports 1024–49151 are “registered”, so that common applications can have a usual port number.  However, most services are able to bind any port number in this range.  The Internet Assigned Numbers Authority (IANA) is responsible for registering the numbers in these ranges.
  • 7. OTHER COMMON PORTS  Even if you will rarely need a complete catalogue of all port numbers for services, you can rapidly start to memorize port numbers for the common services that you use daily. For example, you will very likely come across the following ports regularly:  80 HTTP  8080 HTTP (for testing servers)  443 HTTPS  22 SSH (Secure Shell)  23 Telnet  25 SMTP (outbound email)  110 POP3 (inbound email)  220 IMAP (inbound email) 
  • 8. APPLICATION LAYER PROTOCOLS  We have seen examples of protocols at the different layers of the TCP/IP stack, from the low-level communication across wired Ethernet, the low-level IP communication, and the TCP transport layer.  Now we come to the highest layer of the stack, the application layer. This is the layer you are most likely to interact with while prototyping an Internet of Things project.
  • 9.
  • 10.  A protocol is a set of rules for communication between computers. It includes rules about how to initiate the conversation and what format the messages should be in.  It determines what inputs are understood and what output is transmitted.  It also specifies how the messages are sent and authenticated and how to handle (and maybe correct) errors caused by transmission.
  • 11.  some application layer protocols, starting with HTTP  HTTP  The Internet is much more than just “the web”, but inevitably web services carried over HTTP hold a large part of our attention when looking at the Internet of Things.  HTTP is, at its core, a simple protocol. The client requests a resource by sending a command to a URL, with some headers.
  • 12.  We use the current version of HTTP, 1.1, in these examples. Let’s try to get a simple document  at http://book.roomofthings.com/hello.txt. You can see the result if you open the URL in your web browser.
  • 13.
  • 14.  But let’s look at what the browser is actually sending to the server to do this.The basic structure of the request would look like this:  GET /hello.txt HTTP/1.1  Host: book.roomofthings.com  Notice how the message is written in plain text, in a human-readable way (this might sound obvious, but not all protocols are; the messages could be encoded into bytes in a binary protocol, for example).  We specified the GET method because we’re simply getting the page. We then tell the server which resource we want (/hello.txt) and what version of the protocol we’re using.
  • 15. HTTPS: ENCRYPTED HTTP  We have seen how the request and response are created in a simple text format. If someone eavesdropped your connection (easy to do with tools such as Wireshark if you have access to the network at either end), that person can easily read the conversation.  In fact, it isn’t the format of the protocol that is the problem: even if the conversation happened in binary, an attacker could write a tool to translate the format into something readable.
  • 16.  Rather, the problem is that the conversation isn’t encrypted. The HTTPS protocol is actually just a mix- up of plain old HTTP over the Secure Socket Layer (SSL) protocol.  An HTTPS server listens to a different port (usually 443) and on connection sets up a secure, encrypted connection with the client . When that’s established, both sides just speak HTTP to each other as before!
  • 17.  This means that a network snooper can find out only the IP address and port number of the request (because both of these are public information in the envelope of the underlying TCP message, there’s no way around that).  After that, all it can see is that packets of data are being sent in a request and packets are returned for the response.