CO910-Module 8
CO910-Module 8
COMP-CO910
Introduction to Networking
Today’s Agenda
• A high-level explanation of network ports
• “Well-known ports”
• “Registered ports”
• “Dynamic ports” / “Ephemeral ports”
• Commonly used ports
2
v.F21.0.0 – © 2021 Simon Galton
Network Ports
• In our last discussion we introduced the concept of ports (and,
when combined with a node’s IP address, sockets)
• Recall that although every network node on a TCP/IP network
has an IP address (actually, it can have more than one, but
that’s not really the point), but if we want to provide lots of
services from that host we need a secondary identifier to
connect to that service – that’s our port number
• Our analogy compared system addresses + port numbers to
the street addresses of apartment buildings + apartment unit
numbers
3
v.F21.0.0 – © 2021 Simon Galton
Network Ports
• Ports are really the endpoints for communications with a
network device
• With TCP/IP networking you must use a socket – in other words
you never just connect to a server via its address, you must
always specify a port at that address
• Both the TCP and UDP transport protocols use ports
• A port is a number between 0 and 65535 – but there’s some
structure to that range (we’ll get back to that idea shortly)
4
v.F21.0.0 – © 2021 Simon Galton
Network Ports
• When writing a network application, programmers create a
type of file descriptor (don’t worry, you’ll be doing that in your
programming classes soon enough, if you haven’t done so
already) called an internet socket that combines the
specification for the transport protocol, the IP address and a
port number
This is called binding – it’s how a socket is created
• The OS now transmits outgoing data from all the application
ports onto the appropriate network and forwards incoming
packets to running processes by matching the packet’s
destination IP address and port number to a socket
5
v.F21.0.0 – © 2021 Simon Galton
Network Ports
• Only one process can bind to a specific port number on a given
address
After all, how would the OS know which process to hand the incoming
packet to if many of them could bind to the same socket?
• In situations where many incoming connections to a port are
expected, such as a web server, a commonly used technique
has one process monitoring the port for incoming requests (this
process is then known as a listener) that hands off incoming
clients to other processes to do the work requested, while the
listener immediately goes back to monitoring for incoming
connections
6
v.F21.0.0 – © 2021 Simon Galton
8
v.F21.0.0 – © 2021 Simon Galton
You are likely to see a variant of HTTP on most modern websites called
HTTPS, but the underlying idea we’re explaining here is the same
9
v.F21.0.0 – © 2021 Simon Galton
192.168.0.10:60189 52.60.149.28:80 11
v.F21.0.0 – © 2021 Simon Galton
Regular
Users
13
v.F21.0.0 – © 2021 Simon Galton
192.168.0.10:60189 52.60.149.28:80
Client computer requesting a web page Web server for
from mymohawk.mohawkcollege.ca mymohawk.mohawkcollege.ca
19
v.F21.0.0 – © 2021 Simon Galton
Presentations! Yay!
• There are a LOT of protocols and ports out there – far too many
for us to discuss in any detail as a class
• However, we can still spend some time learning about them
then presenting our findings to the rest of the class
• That’s right – you’re each going to investigate a protocol and
port and give a 7-10 minute presentation about it to the class!
21
v.F21.0.0 – © 2021 Simon Galton
Presentations! Yay!
• I have no doubt that you’ll be spellbound by your colleagues
work and will be eager to attend all the presentations
• Of course, because you will also be contributing feedback to
the presenter of two other presentations you’ll have yet
another reason to listen closely and appreciate their efforts!
Did you know that you’ll soon be taking a class that is designed to boost
your presentation skills?
Communications skills are ranked even higher than many technical skills
by the companies that employ our students and graduates, so it’s one of
our priorities to build your presentation confidence and skills!
22
v.F21.0.0 – © 2021 Simon Galton
Presentations! Yay!
• I have posted a signup form and you will put your name against
the protocol you want to research and present
• First-come, first-served – sign up quickly if there’s something
that catches your eye
• If there’s a protocol not on the list that you really, really want
to share with us just let me know – I’d be happy to add it to the
list with your name on it!
23
v.F21.0.0 – © 2021 Simon Galton
Presentations! Yay!
• I know you’ve got lots of other stuff going in your other classes,
so you’ll have a few weeks to come up with something you’ll
be proud to present
• I’ll also give you some time in this class to take a look at the list
of options and to investigate which one you might want to sign
up for
• Some of you may choose to start pulling some facts together as
well
24
v.F21.0.0 – © 2021 Simon Galton
Presentations! Yay!
• The details of the assignment are posted, including how the
presentations will be graded – but I know it’s a little daunting
when you don’t know what I’m looking for (and this is probably
the first presentation you’re doing here at College)
• So, I think I’ll spend a few minutes modelling what I’m looking
for! I’m going to give you an example presentation!
Of course, I’m not going to use a real protocol – I’ll save them for
you to present!
Will someone be willing to time me? I’m shooting for 7-8 minutes,
which should leave a couple of minutes for questions at the end
25
v.F21.0.0 – © 2021 Simon Galton
EXAMPLE PRESENTATION
v.F21.0.0 – © 2021 Simon Galton
Welcome!
• Today’s Agenda:
• Introduction
• My Protocol!
• What is it?
• What port does it use?
• What was it created to do?
• Two fun facts about my chosen protocol
• Q+A
27
v.F21.0.0 – © 2021 Simon Galton
Introduction
• My name is Simon Galton
• My student number is, well, I
don’t have one because I am a
Professor at Mohawk College
• I have worked in the IT field for
almost 30 years
• For a large part of my career I
built giant Linux computer
clusters!
28
v.F21.0.0 – © 2021 Simon Galton
My Protocol
• After reading the list I realized there was only one protocol that
I wanted to present:
TERMNATR
29
v.F21.0.0 – © 2021 Simon Galton
My Protocol: TERMNATR
• The TERMNATR protocol uses port 1984
• It was created by Cyberdyne systems
• Most of the work was done by Skynet, one of their subsidiaries
• Several updated versions have also been created
• Runs on many platforms
• Can often be mistaken for other protocols
30
v.F21.0.0 – © 2021 Simon Galton
My Protocol: TERMNATR
• The TERMNATR protocol was created to eliminate running or
potential occurrences of any process name John Connor
• If it cannot find John Connor it will seek to stop it’s parent
process that is usually called Sarah Connor
• The protocol follows a simple multi-step process:
31
v.F21.0.0 – © 2021 Simon Galton
My Protocol: TERMNATR
T T
A
E R
G
R E
M T
N S
Y
A S
T T
E
R M
32
v.F21.0.0 – © 2021 Simon Galton
33
v.F21.0.0 – © 2021 Simon Galton
35
v.F21.0.0 – © 2021 Simon Galton
My Protocol: TERMNATR
• Are there any questions?
36
v.F21.0.0 – © 2021 Simon Galton
End