there you go anyways so uh so I set up
another camera right beside my zoom
camera so now I can record this class in
4k and then upload it to YouTube because
zoom's video resolution is garbage so
anyways hopefully uh after this is over
we're going to start having uh these
videos up on YouTube for permanent
collection or whatever and they will be
higher quality because it'll actually be
in 4K so this is this might be 1080p
that is actually 4K so anyways that's
what I forgot about uh so anyways okay
uh if you're new here uh I'm known as
Eli the computer guy been doing Tech
education since 2009 been doing Tech
since 1996 been in the Army been in the
corporate world was a consultant had my
own company been doing YouTube videos
right anyways uh YouTube is a disaster
best thing for another time I'm trying
to I a rat trying to get off the social
media ship and so that's why we have
silicon Doo basically the idea with
silicon Doo is authorless gatekeeper
free unties are hands on technology
education that empowers you to do
whatever the hell it is that you want to
do again somebody that actually cares
about education I think about this I'm a
Buddhist I'm not a good Buddhist not
going to prosze don't worry one of the
things that I think about is when I was
in my 20s I used to read the sutris um
religious scripture I don't know stories
one of the things I always thought was
interesting uh with with sidartha sartha
was Buddha anyways basically sitting
under a tree with a student uh teaching
enlightenment right and you think about
it however however you feel about it
Enlightenment the concept is probably
one of the most valuable things in the
world why do we exist and how do we deal
with a concept of existing and do you
know what sedara needed in order to
teach students about Enlightenment he
needed him he needed a teacher he needed
a student and he needed a tree to keep
the light the the sun off and think
about that think about a time when what
education required was a smart person a
student and a tree for
comfort and then just toose that with
the modern world of our 2 tier year olds
are coming out of college with ruinous
amounts of
debt and so basically my thought with
this is what if we could get back to
trees that seems weird right why why why
does college education why does any
education into cost it nearly the amount
that it does why does education need to
cost a ruinous amount of money when all
we really need as a smart person a
student and a tree whatever that is in
the virtual world anyways that's the
concept silicon Dojo uh it is a free
toer basically the idea is to abstract
out the financial component money over
here education over here neither of the
two should meet um it isn't actually
free I don't have sponsors Cisco doesn't
give a damn about this billionaires
don't give a damn about this it's kind
of weird uh so if you want to help pay
for this you do have money and you do
have an account that allows you to we do
do donorbox donorbox.org
etcg and basically we do a crowdfunding
system if you throw some money in I can
keep doing these classes uh let's see
here uh if you need to uh ask a question
more than happy to answer questions
these are interactive just make sure you
raise your hand in Zoom wherever the
hand is up there uh I do get people uh
literally raising their hands in the
video and although it's adorable I'm not
going to see it uh let's see here
copyright every all the material that
I'm showing you today um
basically is free for you to use the
only thing that I care about as far as
copyright or intellectual property is my
little happy uh Happy computer symbol
that type of thing any kind of logo
stuff obviously all the other material
you can it's free for you to use it's
free for you to use in commercial again
if you're a Mogadishu and you want to
take the material that I'm using today
to teach your own people and charge them
however much you want to charge them
that is absolutely fine uh Tippy tap or
die so at the end of this class and the
end of all these classes we are going to
have lab
I will tell you A lot of people want to
become technology professionals by
watching right they're like I'm going to
sit here and I'm going to watch so many
videos I become an expert technology
professional and that simply is not how
it works uh you have to do the work
again understanding closing closing uh
quotation marks the difference between
single quotation mark and double
quotation mark understanding delimiters
understanding code blocks all that kind
of stuff if you don't actually do it
you're not actually going to learn it
extra help W3 schools is actually
absolutely awesome and Chad qpt uh again
is not artificial intelligence but it is
really good for answering Tech questions
uh standardization uh we try to
standardize so we standardize here on
VSS code we use vs code we use Python we
use some things we try to standardize on
I do not care what you use as an IDE
that's up to you if you want to use pie
charm that's your business but if you
have any problems it's easier for me to
help troubleshoot your problems if
you're standardized on something uh
material
uh if you care uh so uh again all these
videos I have the elied computer guy
YouTube channel with again those million
subscribers and if you see all the
classes we've done up until now they are
all here and very crappy resolution
hopefully now we're going to start
having these videos in 4K resolution but
we'll see how that goes uh we have the
GitHub account so if you go to
GitHub oh why is it doing that that's
not the one it's supposed to
have give me
GitHub you go to the GitHub account so
we have Hub /s cond dojo and you come
here and this is all the material for
all of these different classes you come
to tcpip for programmers today's class
uh you'll notice we have lab books and
we have workbooks if you click on the
workbook this is all of the slides uh
basically you know three slides to a
page with some lines so you can scribble
down notes scribble down notes everybody
including me thinks I don't have to
write notes I'm smart enough to remember
this no you're not write notes I'm just
telling you write notes uh anyways and
then we have the lab book so again for
the projects that we're going to do at
the end of these classes and tcpip for
programmers we have getting Mac address
information with rest apis and these are
the little Labs that you can do so I
would highly recommend that you print
them out also if you're interested in
following me on LinkedIn you can find me
at Eli Etherton on LinkedIn with that
symbol um to see what I'm up to uh let's
see here and that's it and trolls uh
just so you know uh you are not allowed
to unmute Yourself by yourself um I have
to unmute you so that we go to get
trolls we got that before uh and the
chat so the chat is open you can go to
the chat you can say very polite things
in the chat um if I see the chat go to
hell I'm not doing moderation I'm just
turning chat off for everybody so if
chat is no longer functioning for some
reason it's probably because somebody
decided to be stupid uh and that is that
is the
beginning of the class so we have no
more people to add oh I got another
person to add in okay morat
tuna it is kind of funny when you see
people's names for all around the world
and in your language you're like and
then you realize in their language you
shouldn't laugh at
it curious name curious name so anyways
you're right you're late
if I gave grades I'd fail you but I I
don't give
grades anyways so today's class is going
to be TCP IP for programmers
transmission control protocol IP
protocol version 4 for programmers uh
and this is an important thing again I
come from the systems world I got my
mcse back in
2000 and I dealt with God knows how many
versions of Windows and Linux dealing
with Cisco equipment all kinds of
networking equipment and the rest of it
and one of the things that I find
interesting with python again my bias my
bias when I'm educating you folks is I'm
interested in that systems World um
probably doesn't make a damn bit of
sense when I say it to you folks but
basically what do domains look like in
the 2020s and you're like what does that
mean it takes too long anyways but
that's what I'm actually interested in
what tcpip does right this is the
protocol this is the language that
allows systems to talk to each other
the more you understand how systems talk
to each other uh the better it is uh for
actually designing and building your
architecture and also the better it is
for things little things like cyber
security hey hey if you don't want Brute
Force attacks on Port 22 which is
something called SSH maybe maybe block
Port 22 in your
Fireball but we're going to talk about
that kind of thing today uh why tcpip
matters for coders architecture
architecture architect texure again I do
not know what the hell has happened over
the past 15 years Tech again I've been
doing Tech since 1996 so I've seen
multip multiple generations of tech at
this point and I don't know what the
hell has been going on in the past
decade because basically we have all
these coders out there that kind of feel
like they don't need to understand
anything else in the tech World um right
if you can do Java Script that's all you
need to know for some
reason which is dumb which is dumb again
I would argue everybody should be what
is called a full stack developer you
might not be a good full stack
developers that might not be what you do
every day but you should more or less
understand uh the full stack and
basically with tcpip why this matters is
this is how you can use networking to
connect all of the servers or services
that your platform or your system is
going to be interacting with and you can
determine which type type of solution uh
gives you the best return on an
investment and so why this becomes
important is I think about companies
like uh there's a company that died
called vidm so vidm was going to be a
competitor to YouTube and they burned
through $9 million in funding and one of
the reasons is is because they decided
to be a competitor to YouTube uh
basically purely using AWS as their
infastructure and you might be sitting
there going what's wrong with that right
a is not AWS good what they should have
gone to aour
well the thing is is whenever you look
at cloud computing infrastructure and
whenever you look at any type of
infrastructure right there's return on
investment there's price points there's
total cost of ownership there's all this
kind of stuff right so one of the nice
things with Cloud infrastructure whether
it's AWS or is your or whoever else is
basically uh in order to start up in
order to spin up something uh it cost
you like 50 cents right and then it just
grows from there right so it's great so
you don't have to buy a server you don't
have to Rack a server you don't have to
worry about collocation facilities you
don't have to worry about all that fixed
that Capital cost that fixed asset cost
initially you can just swipe your credit
card for a couple of bucks and see if
anybody cares about the uh whatever it
is that you're offering which is great
the issue is is when you use cloud
services some of the solutions some of
the resources that they provide are dirt
cheap at scale and some of the services
that they provide are brutally expensive
at scale and so if you look at a company
it's like a vidme if you're going to
create a competitor for YouTube Here's
the thing if you are looking at at basic
basic compute code running python
running right AWS Azure dirt keep put it
up there if you're looking for database
right again we did a class on SQL light
that is SQL you know structure query
language relational database incredibly
simple again one of the things to think
about is when you start going at scale
that stuff gets a hell of a lot more
complicated you have replication
strategies and disaster recovery and
it's a disaster anyways right so
database on AWS Azure is going to cost
you pennies right no matter how big that
database is on AWS it is going to be a
crack ton less expensive than hiring the
administrator that you would need in
order to actually be able to set up your
own database server so those types of
things are incredibly
inexpensive what is incredibly nosebleed
expensive on wild infrastructure is data
storage so storage and bandwidth so
AWS back I don't know what quite it is
at this point um it costs 9 cents per
gig in
transfer so if I upload a 1080p video
that's 2 hours long right that's
probably going to be about two
gigs so so vidme sets up their entire
infrastructure on
AWS every 2 hours of 1080p video watched
is going to cost 18 cents at
least now multiply that crap at
scale again a wild true Loop essentially
uh every gig going to cost you 9 cents
that doesn't seem like a lot until you
got a thousands and thousands and
thousands and thousands of years users
who are simply clicking on the play
button and going off to do something
else right Burns a lot of money well the
thing is right if you're all in the AWS
world if you don't really understand
again how architecture works you really
don't understand how tcpip works right
you're kind of lock you're locked into
their ecosystem if you're going to use
their compute and you're going to use
their their database then you're going
to also going to have to use their
storage
buckets but here's the thing if you
understand how tcpi boy works and AR Ure
works you can have the cloud
infrastructure right you can have that
compute you can have that database very
cost competitive right you can have that
up there and then you can then spin up
you can create your own uh storage
servers and again you might spend you
might spend
$5,000 for a storage server with all the
uh with all the hard drives that you
need at this particular point in time
you put into a cooc facility collocation
facility might cost you $1,000 a month
so $1,000 a month uh for a rack with a
one gig connection one gig connection
can get you oh 300 concurrent 1080p
video streams at a time more or less
there's some more math that goes into it
but just go for that way so good so you
think about it uh a rack $1,000 a month
with a server that cost you5 $10,000 and
again that actually has a a a capital
cost has a fixed asset cost but but once
you've paid it you're not paying any
more than that $1,000 a month so whether
you have 10 users hit your site you're
paying $1,000 a month if you1 users hit
your site you're paying $1,000 a month
and if you have 10,000 users hit your
site you're you're you're paying $1,000
a month and so one of the things to
really be thinking about again when you
start designing these systems in the
modern world again isn't simply
about does the does the the resource
technically function but also from a
business aspect uh are you are you
Building Systems in the most coste
effective ways because that is going to
matter right in order for you to exit
right you get in that startup company
you want that IPO you want that exit
well the important thing to get to that
IPO is that your company doesn't burn
all its damn money before it gets
there anyways so that's why this kind of
thing is important uh architecture uh
we're going to be talking today uh
there's going to be the concept between
physical versus logical especially for
the new people this can get uh confusing
uh so basically what logic is is when we
start we go to our whiteboard and we
start sketching things out right we are
going to sketch things out we are going
to design
Things based off of a logical concept
right it's like okay okay so we have the
cloud up here so we call the internet
cloud and that's going to come into my
facility when it comes into my facility
it is going to come into a modem from
that modem it is going to come into
something called a router from that
router it is going then going to go into
a switch and that switch is what all of
our hosts and servers and such are going
to connect to now in order for us to
have Wi-Fi we from this switch basically
we need a wireless access point uh and
that will give us the Wi-Fi signal uh so
everybody you know can get
wireless met this
person um and then beyond this uh you
may put a firewall in here so so
firewall go basically between the router
and you might do some other things right
so this is how I'm designing things
logically it's like okay so I need the
modem and I need the router and I need
the switch and I need the access point
and I need whatever and again depending
on the solution you may need different
things this is how you whiteboard it out
now in the real world though again if
you go and you
look at your
actual uh device uh many times uh the
actual physical device itself has a
number of different logical components
inside of it uh so with this so again
this seems pretty simple like Eli that's
a switch that's a switch isn't that both
a logical switch and a physical switch
well it is a logical switch it's it is a
switch something called a switch but
it's also a Poe injector there's
something called power over ethernet
where you can actually power devices
directly from your ethernet cable and so
this has a Poe injector built into it so
if I had Poe devices I might you know on
here you know do Poe injector
as again an additional logical thing but
that both both the switch and the poe
injector are logical Concepts that are
built in this one physical device again
if you look at your the modem if you use
Comcast Verizon Quest whoever else you
look at that modem that they send you in
the mail that will be a modem and that
will be a router and that will be a
switch and that will be an access point
logically and physically all that is
built into one
device oops and I do not want AI to
create a companion thing for this is
anybody else just tired of them trying
to shove AI into everything it is funny
nowadays I keep being told I keep being
told AI is the future and they keep
trying to shove it into everything that
I do and I don't want it anywhere
anyways that's this all so logical
devices are for specific Services
firewall router modem access point uh
these uh can still still be dedicated
devices but are generally built into a
single device um blah blah blah yeah so
that is the point there uh okay it come
down beware of caching um so when you
start dealing with tcpi and network what
literally I get this thing that comes up
start meeting summary with AI companion
oh Mike is requesting you start meeting
summary Mike
F you want a freaking AI
summary or you could just take notes
Mike or you could just take
notes anyways argument for another time
okay beware of cashing so when you start
dealing with the networking world and a
lot of stuff in the IT world one of the
things that is incredibly valuable and
also incredibly a pan in the ass exact
same time is caching basically what
caching is is uh when you have your
system whether it's a host whether it's
a router whether it's a server whatever
else right what's going to happen is
your little host your little computer
here is going to go through your
networking equipment that's going to go
up to the cloud that's going to be your
make a request of somebody else's server
and then the information is going to get
sent back to your computer right this
whole round trip thing uh takes a lot of
time takes a lot of resources and so hey
if you could save the previous response
into a local table wouldn't that make
everything quicker instead of always
having to do this Loop what if you could
just go to a cach uh see whether or not
you already have a result there and then
if you do just pull it from that right
and so anyways caches generally are
phenomenal generally normally you don't
have any problems with the caches the
issue is is when you start making
changes and again this is a big thing
when you are deploying in infrastructure
if you're adding doing migrations you
start making a lot of changes at one
time well the issue is your host your
computer may have a cash your router may
have a cash other things up the line of
networking may have a cash and so when
you go to make your request so again
we're going to do talking about DNS so a
DNS is resolution so let's say
CNN.com goes to
56108 44.2 let's say that's the IP add
address if you want to change this IP
address for some reason this may have
been cashed in multiple places along
this line and so you may be getting old
results for a long time after you've
made changes again the problem with
Noobs right with oldtimers what we do is
we make a change and then we go grab a
cup of coffee then maybe we have lunch
maybe take a little nap then after a
while come back and see if the change is
what's called replicated through
uh the problem is with new people they
make a change they immediately try to
verify that the change has taken effect
all of a sudden they start getting
cashed
responses which are wrong
responses and then everything goes to
hell as they start ripping through all
the configurations in their server and
it's a freaking disaster so anyways uh
cashes cashes exist be careful about
them you'll learn in other classes and
things about clearing cashes is
basically automatically most of these
caches clear within a certain amount of
time and that's where you'll see if you
go out and you buy a domain name so you
go outad and by Eli computer guide.com
and you point it to an IP address one of
the things that you will see when you
change uh that
configuration uh is uh it'll tell you it
will take up to 24 hours to replicate
throughout the internet now normally
doesn't again it's 2024 not 2004
normally it takes about 30 minutes to
replicate but if you're wondering what
that's about is this horse crap is
that's what it's about okay let's see
here um what is a protocol so protocol
basically that's what we're talking
about today we're talk about
tcpip version 4 transmission control
protocol Internet Protocol version 4 it
is a language for computers to talk to
each other uh so you're going to hear a
lot about protocols as we go in these
classes because just about everything
requires a language again if you have
computers and systems talking to each
other they need a langu language to be
able to talk to each other and so tcpip
is the basic what's called a networking
protocol that allows them to connect
together there are different types of
protocols out there there are network
protocols so tcpip uh again old ones you
don't know about ipx SPX net Buy Apple
talk bonjour don't worry about any of
those other words words that you can
forget all you have to remember is tcpip
version 4 or version six those are
networking protocols you also have
things like storage protocols so there's
something called ice scuzzy other things
that like that that allow you to
basically do storage Services over the
network which is really kind of cool you
have communications protocols rmtp is
real time or rtmp realtime media
protocol sip session initiated protocol
uh those types of protocols those are
used for things like realtime
communication when you do voice voice
over IP or video over IP those types of
things and so that's what we're talking
about with protocol so again we have
tcpip we have FTP file transfer protocol
you probably heard about again sit rtmp
I scuzzy these are just simply languages
all these languages require their own
configurations for them to work properly
and so as with anything if you're going
to be using them you're probably going
to have to be reading a little bit to
figure out how to properly use them oh
ger
all it is 30 minutes past class
anyways see the nice part about the fact
that you guys can neither pass nor fail
these classes is I don't have to get
stressed if you don't learn anything
anyways what about tcpip V6
Eli I've heard tcpip version 6 is the
future why am I worrying with tcpip
version 4 and I'm going to tell you
something right back when back when I
was a little whippers Snapper back when
I was knee high to a squirrel I asked
the exact same question right back in
2000 I was getting my mcse I went to my
mcse instructor he was this Filipino guy
this long beautiful black hair rode the
Ninja motorcycle he's like a black build
and Filipino stick fighting is a really
cool guy that was back when computer
people were cool anyways and that was
the thing right so we were learning
tcpip version 4 right tcpip version 4
and then people kept talking they kept
talking about tcpip version 6 and we had
to take a test so I actually got my mCP
plus I and that was just for learning
tcpip back in the day and I was like why
why are we spending all of this time to
learn tcpi version 4 when tcpip version
6 you know is going to be here in a
couple of years
well because that's that's not how the
technology World works right literally
in 2000 I was told by my MCS instructor
I apologize that you're going to have to
learn tcpip version 4 but unfortunately
you're coming in at one of those
Crossroads in the technology world where
the new protocol is out it's stable
everybody wants to go to it there's
reasons why the old protocol should die
but we're in that middle ground so
you're just gonna have to study a lot to
learn about a protocol that will be
obsolete within a couple of
years and that was in 2000 and that was
in
2000 uh as they say tomorrow is always a
day away there was this idea that we
were going to run out of something
called IP version for addresses we'll
talk about that um and it simply didn't
happen uh Legacy systems have a nasty
habit of not dying when they
should and unfortunately there is not a
a technical way to put a pillow over
Legacy systems to get it over with
unless you're Steve Jobs Steve Jobs
killed flash pretty damn quick but
unless you're Steve Jobs you're kind of
stuck with stuff so there is something
called tcpi version 6 as far as I can
tell it is far superior to tcpip version
4 we definitely all should be on tcpip
version 6 at this point in time
and
yeah yeah man
tomorrow is always a day
away uh okay so we start talking about
tcpi version 4 then we have to start
talking about the basics uh so the
basics is basically the ethernet
standard so tcpip version 4 runs over
the ethernet right so Ethernet or
ethernet as people incorrectly stated
again you will notice I say words that
may be different from you again one I've
been doing this field for 30 years words
actually the pron I iation actually does
change over 30 years um and then also we
just have differences of opinion I call
it ethernet I actually do some research
apparently 20% of the world calls it
ethernet and then 80% of the world is
wrong and they call it
ethernet I'm the instructor I call it
ethernet you call it whatever the hell
you want to call it there's no test
anyways there's a standard called
ethernet right and so this is all the
lowest level stuff before we get to the
protocol before we get to tcpip version
version 4 or tcpip version 6 or ipx or
apple talk or net bu or bonjour or a
whole bunch of other words that you
don't need to worry about you have to
get to the ethernet standard and
basically this is the basics of how all
this crap is connected together so
you'll hear about
RJ45 connectors and so these are the
connectors that are basically double the
size of good old five fashioned
telephone connectors right that is the
connector that is used in the ethernet
standard um
Mike Mike don't make me ban you I see
you Mike stop stop before I turn off
chat anyways so EET standard is that we
use our j45 connectors again there are
other networking types they use
different connectors right uh the cable
that we use we use a twisted pair cable
right uh if you take a look at Cat 5
cable so there's cat 3 cable Cat 5 cable
there's now cat 6 cable is there cat s
cable anyways these are ethernet cables
so that those numbers uh differentiate
basically different speeds uh for how
fast data can be transferred over the
cable uh but anyways how those cables
are created that is part of the ethernet
standard uh with ethernet we have
something called a star typology uh so
there are ring typologies typology is
basically how everything is connected
together so if you ever have the
disaster of dealing with a protocol
called Pelco D which hopefully none of
you you ever will you will learn the
pain of ring top topologies but
basically topology is how things are
connected together so you hear hear
about like a ring and basically what a
ring is is you have hosts and basically
the input goes into one side of the host
and then the output goes out input goes
out right and basically that's how
things are connected together basically
if there is a failure anywhere along
this ring all hell breaks loose and it
is a disaster a complete another damn
disaster TR travel shoot anyways that is
called a ring uh typology you will also
hear of bus typologies this you'll
actually H this you actually deal with
you probably don't normally see uh with
cable so when you're dealing with a
cable internet connection basically what
a bus typology is is you have one cable
that goes out there's a Terminator at
the end uh this cable connects you know
the server whatever the the the network
infrastructure and then basically all of
the devices are Simply Connected uh
along what is called the bus um and
again cable internet at least how it was
last time I took a look at it actually
uses this B bus typology uh good uh for
many things again the problem is is if
you get a break in the line everything
past that break fails so good for
certain things bad for many other things
so what we get to with the Ethan not uh
typology is you get What's called the
star uh so back in the days you had
things called hubs do not use hubs but
they did exist you got these things
called hubs and basically uh everything
connected all the hosts connected and so
as long as nothing happened to the hub
here right if if a if there's a break in
the line on this particular network
connection then this host drops off the
network nothing else happens right if
something happens here this host drops
off the network nothing else happens you
know again as long as nothing breaks the
Hub you break the Hub everything goes to
h but anyways you get the point this is
what is called a star type typology and
that is what we get to in the ethernet
world uh along with that um basically uh
with the ethernet standard uh there has
to be a way to identify devices so all
of these computers that are you
connecting into a hub or a switch right
uh there has to be an identifier for
those again remember in the computer
world nothing magically happens
everything has to be designed so how do
you know the difference between computer
a and computer B right so that's where
you have called Mac addresses there's a
something called the data link layer
anyways Mac addresses media Access
Control addresses these are hardcoded
addresses into every single Network Port
that uses the ethernet standard and
basically that is how ethernet is able
to know the difference uh between
devices uh the other big thing with the
ethernet standard and this is uh this
will become ever more important as we go
along is you have what are called
Collision domains
which gets to be
fun oh there is nothing so unamusing as
something called a broadcast storm
anyways what what the um collision
domain means right so basically you have
this Central Point used to be called a
hub now it's called a switch it's a
different thing that all of these
devices are connected into right well
again one of the things you have to be
thinking about is how do these devices
actually communicate with each other it
doesn't happen magically you actually
have to design system so how how does
this computer again if you have one
cable connecting all these so basically
this is all connected together here
they're all basically in a hub
environment they're all using the same
cable so if one person is talking right
you can't have two people talking at the
same time basically they'll talk over
each other and communication goes to
hell so basically what we have with the
ethernet standard is the device that
wants to talk will listen it'll listen
to hear if anybody else is talking on
the line if nobody else is talking the
line it will send out its communication
that communication will go out to
everybody else again they Hub we talk
about that minut right and then whoever
is actually supposed to get the
communication receive the communication
and then once that computer receiv
receives a communication it's supposed
to do something send back a file
whatever else so it'll listen it'll
listen to see if anybody else is talking
if nobody else is talking it will then
send out the communication so on and so
forth so that doesn't sound too bad
right you got three computers on a
network four computers on a network 10
computers on a network that system
doesn't sound too bad but here's the
thing
right what happens if this computer
listens and this computer listens at the
exact same time and neither of them hear
anything neither of them hear anything
because nobody's talking at this moment
they go oh great I can talk and so this
computer tries to talk and this computer
tries to talk and basically what you get
is when they both are trying to talk you
get a collision uh in the network right
so so both of these uh the these hosts
hear the Collision they actually hear
that there there was a problem with
sending their their data and so they're
good little they're good little hosts
and they basically wait for a random
amount of time to try to resend the data
right so this one might try to send it
again let's say 1 second this one might
try to send it again in 1.5 seconds
again the same process they listen then
they send data and normally that's fine
but what happens again when you have a
thund computers on the network or a
thousand computers on the network right
you have a thousand computers listening
a thousand computers hearing nobody else
is talking and a thousand computers all
at the same time trying to talk a
thousand computers then hear Collision
the Collision of their their data online
so a th computers then wait a random
amount of time before they try to talk
again and then out of those thousand
computers 200 computers then try to talk
again those 200 under computers hear the
collision and basically you get what is
called a broadcast storm and your entire
network oh it's just just not
pretty just sucks just sucks so anyways
this is what we're talking about when
you hear about Collision domains this is
what we're talking about again in the
modern world again I keep talking about
hubs and hubs should be in the trash uh
other Collision domains that you'll deal
with in the modern world is Wi-Fi uh so
Wi-Fi you'll hear about multi- in
multi-out antennas multiple antennas the
reason is is because each one of those
antenna basically operates as its own
collision domain so if you have 50 WiFi
devices all trying to communicate with
one
antenna you're going to start having
problems and so that's why they have myo
so they might have five antenna or a 10
antenna to try to have more Collision
domains so that you can have more
computers all talking at the same time
uh let's see here Jack what's up Jack
can you hear me yep sorry I'm just get
back I have two questions one uh the
ring analogy that you gave is another
way of saying that is a node the
computer can be a node in that in that U
ring
scenario and the second question is with
Collision attacks in all computers
talking to one on a network how come
that doesn't happen with server
because I know a whole bunch of requests
are made to a server which is on a
network and but it's returns back the
information how come servers don't crash
in the same sense or maybe I'm
understanding it all well all these
computers here what we call a host a
host uh is a computer might be a
computer might be a server might be a
print server right uh so why they don't
crash in the modern world is because
it's 2024 and we use something called
switches I'll talk about in a second
that's why uh as far as the nodes so
generally a so a host in a system is
basically any computer generally a
server a client computer your smartphone
they may all be host nodes many time uh
denote that it's some kind of connection
and so that's where like I say this
protocol called Pelco D which is
complete under disaster never use it
even if you have to uh basically what
happens there is it's for camera devices
and so
so literally what
happens is again the input you have one
input and then you have one output you
have one input you have one output you
have one input you have one output so
the problem in this particular
environment is the host itself is
actually a node on the network so it's
it send it it receives communication but
it also sends that communication on so
the issue is it's not just here so if
this line f fails obviously you're going
to have a problem but also if something
happens to this camera if something
happens to this node that will also
bring down the ring component of your
network U so you're talking about nodes
that's a little bit of the difference
generally between hosts and nodes um but
yeah that what what's going on there but
again don't worry I I don't know in the
modern world you guys dealing with ring
typologies you probably won't deal with
it other than taking a net plus test to
be honest with you hopefully unless you
deal with felco d and then quit and then
quit answer your
question yeah you're already muted again
okay uh so we get to Mac addresses uh
media Access Control addresses uh this
these work on the OSI layer called data
link layer it's called the layer two and
we'll deal with the OSI model at some
point going into the future now one of
the big things with Mac addresses is you
will hear in the modern world right
there will be conspiracy theorists out
there and they got their beautiful
little T foil hats on and they're going
to tell you a deep dark secret and that
deep dark secret is that the government
is trying to create a unique ID a serial
number for everybody's computer in the
world so that the government the global
Elite can track
everybody right and they're going to say
things like that and that's going to
make you scared you're going to be like
oh my God what happens if all the
computers in the world world have unique
Social Security numbers that can be
tracked wouldn't that be
horrible and I am here to tell you as
Eli the computer guy it would be
horrible if it wasn't literally built
into the damn ethernet standard that
we've all been using for about 40 years
at this point in
time every every port every port on
every networking device has something
called a MAC address it is a univer it's
supposed to be it's a supposed to be a
universally uh unique identifier so that
every single port that is ever been
produced has a different Mac address so
that uh computer networks basically know
where to send
data uh so so
yeah wouldn't it be horrible if we
already had that problem 40 years ago
anyways right so anyways the MAC address
is a a a universal supposed to be a
universally unique identifier uh the
first part of the MAC address whenever
you take a look at a MAC address uh is
going to be the vendor ID basically
whoever produced uh the particular uh
product that you have uh the second part
of the ID is essentially going to be the
serial number for that product right so
Apple serial number blah Dell serial
number blah Texas Instruments serial
number blah uh if we go over we take a
look uh there is a cool
website to make you feel really scared
you feel really scared because that's my
job it's called Mac vendor lookup.com
we're going to be using this today in
the labs and basically what you can do
is you can plug in the MAC address uh
for for a particular um porch you know
that you have uh and it can tell you
information about that uh computer
without needing anything else right so
this particular Mac address it was a
design it was for the Apple uh an Apple
device the address is here gives you a
range for the vendor IDs and a whole
bunch of different other information but
basically uh the important thing to
understand uh with Mac addresses is this
is basically what a MAC address is and
it is univers literally universally
unique to all ethernet uh devices and so
it can be tracked and it can be used as
a fingerprint yes um let's see here uh
connection basically has to have a MAC
address um and we're going to be using
the rest API uh to find information
about the MAC address going in the
future this is one thing you'll hear
about something called MAC address
filtering so you start talking about
cyber security and you start actually
trying to lock down your environment one
of the things that you can do is you can
permit or block uh Mac addresses from
Simply being able to access the network
so you may have seen this with Wi-Fi
access points going on 10 years ago MAC
address filtering was a big thing back
then uh basically the idea is you can
connect the computer the Wi-Fi you can
say yes I accept that Mac address and
now that computer is able to connect if
somebody kind tries to come in with a
different Mac address they can't this is
also talking about cable internet um you
can do something called Mac address
cloning where although the MAC address
is hardcoded in there are ways to modify
it um again I'm not sure I haven't had
to deal with installing cable internet
for a while but how it used to be is if
you bought your own uh cable internet
box right and you wanted to plug it in
to the uh to the the cable internet
connection from Comcast or whatever
basically you would have to change the
MAC address to me match whatever they
had in their system so basically they
would only allow how they dealt with
access control is they only allowed
specific Mac addresses to be able to
connect to the network and so if you
wanted your your modem to be able to
connect to the network you had to change
that Mac address that's something called
MAC address filtering um so yeah so
basically globally unique Mac address
globally globally unique address that
essentially looks like
that um so we get to Layer Two
networking so I'll clean so layer 2
networking is basically where we're
dealing uh with the ethernet standard
right so we're not talking about tcpip
yet we're simply talking about ethernet
right so whenever you're going to be
connecting things at the ethernet level
uh there's a number of different ways to
connect so the first way is something
called a crossover cable so crossover
cables you take you have your nice
little uh patch cable that you normally
do uh basically they swap two of the the
connectors in there uh so that you can
connect one computer to another computer
directly um and they're able to
communicate with each other if you if
you understand how to set it up so you
can simply connect two computers
together and they can talk then you have
hubs so basically a crossover cable is
one cable that connects two computers
together what a hub is is basically all
it is is a splitter all it is is a
splitter uh for for your network right
so you got all of your different
computers they all Connect into a hub
and then basically what happens is again
when one computer sends Communication in
it goes out to every every single port
in that Hub and again once you get to
about 10 computers that goes to hell
because you start getting what are
called broadcast
storms so then the question became okay
with ethernet again you go back you know
20 30 years ago it's like crap we got
these broadcast storms so we know we can
connect x amount of computers uh to one
Hub right but if we get over that
amount then we're going to get broadcast
storms so that's where they came up with
the idea of something called a bridge
and so what bridge is is you have one
Hub here so you have Hub one here and
hub two here right they have different
computers connected to them and so then
you connect these hubs together and you
put what's called a bridge in the middle
so what happens is when a computer tries
to to communicate right the first time
it tries to communicate and it's looking
for a specific Mac address right what's
going to happen is this bridge is going
to determine whether that Mac address
this computer is looking for is on the
other side of the bridge right that is
that Mac address over here if it
determines that it is it will forward
the traffic over to this other Hub and
then it'll get blasted out every single
port on this other Hub if it knows that
the MAC address is not on the other side
it will simply block that connection so
that this communication traffic stays
simply in one Hub and so the idea is you
could have numerous Bridges and those
would then connect to numerous
hubs and I don't know you get slightly
less than a disas
it is a better solution that's still
kind of crappy so anyways then the idea
is like well wait a minute again it's
the modern world this is 2001 we're
still using hubs and bridges that seems
like the old way to do it what if every
port was a
bridge and that's where we get to
switches which is what we've had for
again 20 plus years at this point and
basically so what a switch is is you
have your switch with all of your little
ports on it they get connected to all of
the
hosts and then what happens is when one
computer uh basically is trying to
communicate with another computer the
first time uh the computer tries to
communicate what'll happen is the
communication will get blasted out every
single port right and then one computer
if there is somebody with that MAC
address on the network it will respond
and and say oh that's me hey it's me and
so now the switch knows that this
particular Mac address is at this
particular Port simply by this
communication and knows this the the MAC
address for this computer is at this
port and the MAC address for this
computer is this port and it has
something called an AR or it's a m sorry
it's a MAC address table something
called a MAC address table basically
like a database table and it says
essentially Mac address at Port Mac
address at Port Mac address at Port Mac
address at Port and so then when this
computer once it talk to this computer
it then simply gets routed to that
computer now right instead of getting
blasted out all the single ports if this
computer wants to talk with this
computer right the switch already knows
where this computer is and so it goes
into the switch it goes through What's
called the back plane and get sent
directly to the computer where it wants
to do the communication and so this is
how we get out of broadcast storms and
this is the the fundamental idea of what
a switch is and why it's important uh
with these switches again you're going
to have something called a MAC address
table basically the MAC address table is
going to have essentially a table for
all of these different Mac addresses
here again
2024 this shouldn't be a problem for
anybody using this again you go back 20
years the hardware that ran switches was
not as good as it is today so you might
have run into problems with the size of
Mac address tables again back back in
the day like you actually had to make
sure that the MAC address table was big
enough for whatever you got to be
dealing with nowadays you don't really
have to worry about it and one of the
things that you might have to worry
about though with this switch is What's
called the back plane so basically what
the back plane is it's it's the
communication uh for all of these ports
together so one of the things that
you'll see whenever you're looking at um
the uh the the spec sheet for a switch
is it'll tell you the speed per Port
right so it'll be a 10 100 probably
1,000 Port so I'll tell you per Port
that's one thing to keep in mind right
what people focus on but then you also
have to see what is the entire capacity
of the switch because just because you
can do a th000 or a gig uh per Port what
if you have 10 or 20 or 50 again if you
have a large switch 50 computers all
trying to communicate at a gig per
second at the exact same time what's
going to happen is you're going to need
to look at what the back plane actually
supports so what does the overall system
throughput for that switch look like
does determine how fast it'll be right
so the so the whole throughput for the
switch might be 10 GBS per second it's
probably going to be a lot higher than
that but it might be right so if you
have if you have 20 computers all trying
to communicate
together uh or at the exact same time uh
and you're you're maxed at 500 gbits per
second then each one of those computers
more or less Horseshoes and Hand
Grenades is going to get maxed about 500
megabits per second so you might run
into some weird uh issues there um so
that is is some ideas about what a
switch is and what broadcast storms are
and so on and so forth uh let's see here
any questions up until this
point no hands up oh if you do get a
question there's throw hand up and when
I look down if I'm at a place I can say
something I'll will say something so we
get to layer three networking so this is
Layer Two networking layer 2 networking
is ethernet layer networking generally
not a hell of a lot of configurations
again in the modern world I'm not sure
what ler 2 protocols exist there might
be some again I talk about something
called net buoy net buy was a protocol
that was used 24 years ago one of the
nice things with net buy is you just
connected computers into a switch or a
hub they all saw each other and way you
go there is no configurations right
because you just plugged it in they all
knew each other's Mac addresses right uh
so that that's a layer Layer Two
protocol again you're probably not going
to run into those nowadays nowadays
you're going to be r running into what
are called layer three protocols which
It generally is going to be tcpip
version 4 or version six if you have
somebody that can actually run it and
basically the idea here is how to start
connecting multiple networks together
right so when I showed you that thing
with Bridges and I showed you that thing
with switches right no no matter how
advanced you make that how the hell are
you going to get a billion devices on
that particular Network right when you
think about the internet when you think
about the internet the internet is one
network of networks but it's one network
right so you're looking at hubs you're
looking at switches and you're looking
at
Bridges how you connect a billion
devices and make any of them talk to
each other God knows so that's where we
get to layer three networking and
basically what layer 3 networking is is
it allows you to be able to create
configurations uh to have routable
networking you use routable protocols
right so basically with this what
happens more or less is you have your
switch as I talked about before and you
have all your computers connected to
your switch you then have what's called
a router uh basically on this side is
your land what called a local area
network and on the external side is
generally called the WAN or the wide
area network routers are then connected
into infrastructure and then basically
those routers are used to contain their
own lands right so you have a switch
over here and that's a land you have a
switch over here and that's a land you
have a switch over here and that's a
land one of the important things to
understand with these routers is again
when you use a routable protocol getting
like tcpip version 4 is it's something
that you can manually address so with
Mac addresses those are hardcode
addresses you more or less can change
with routable uh protocols they
generally have addresses that you can
modify again when I talk about 192 not
16811 that is actually address that I
can go in and I can configure and I can
can change on my host again at a large
scale what happens is all of these
routers have external IP addresses right
and so basically what happens with a
routable layer 3 protocol is uh let's
say I want to go to let's say
CNN.com right what's going to happen is
my computer is going to try to see if
CNN.com is on the local network if it's
not on the local network it'll go out to
the router the router then essentially
goes out to What's called the internet
Cloud uh basically the traffic will then
get routed to CNN's Network it'll go
through the router and then there will
be a switch and there'll be a server up
here and it will get routed to cnn.com
server and then the website will be sent
back to you and so basically with these
layer three routing protocols what
allows you to do it allows you to create
very sophisticated local area networks
those are the networks that you control
but then have those local networks be
connected to larger and larger networks
such as the internet so that you can
start creating this just Beast of
billions of devices that can all
theoretically communicate with each
other you'll have here about Lan so Lan
is the local area network so basically
this is everything in your facility
that's connected to the switch that is
the Lan then you hear about the WAN the
WAN is the wide area network right the
wide area network generally within
institutions um will be the larger
Network that's generally is still not
the internet right
so if you're looking at a w basically
the idea is if you have a large
corporation uh let's say you have an
office in Atlanta and the office in
Atlanta has its land and then let's say
you have an office in Phoenix and the
office in Phoenix has its land and let's
say you have the office in DC and so it
has its land right well the thing is for
all of these offices they're going to
need email Services they're going to
need file Services they need something
called active directory services in the
whole nine yards and so there may be a
data center somewhere uh that has again
ad an email and all that kind of stuff
and so basically all of these offices
will have a router connected to
them and then basically if they need an
email service or whatever else it's not
in the landan it'll essentially go out
to the WAN basically consider the wide
area
network and so the wide area network is
generally something that you own right
but it's larger than that local area
network and then the internet is still
out here beyond that you can have a cans
uh cans are campus area networks those
are becoming sexier lately can was
something that they talked a lot about
again back in 2002 then they stopped
talking about it for about 15 years and
now they're talking about it again for
some reason anyways all these new
companies want to create their own fancy
campuses and so the idea is you create
your own network for your campus and as
a can you'll hear about man is a
metropolitan area network again you may
run into those if you deal with
government uh government services that
type of thing they may have a
metropolitan area network and then you
have the internet but basically all of
these are allowed to happen because we
have this thing called layer three
networking layer 3 networking happens
through routers and basically the
protocols that you're going to be using
is TCP version 4 rv6 or again SPX or ipx
SPX but probably not
we all following we all following I
really feel like I need a virtual
version of a cous ball so I can like
throw virtual cush balls at people but
then that would probably be considered
abuse in the modern world when I was
young my teachers they'd have these
weird cush ball things and if you're
were like Daisy day you know daydreaming
in class they just Wing that cush ball
at you you wouldn't think a really soft
ball could hurt that much but it can
okay so now we get to CTC pip version 4
11 slides in and now we get to start
talking about the protocol you are all
here for so TCI pip version four is a
routable protocol Suite so what do we
mean by a protocol Suite so a protocol
Suite means there are actually multiple
protocols inside the tcpip version 4
Protocol so it's not a single protocol
um so IP um is it's called the Internet
Protocol is an individual protocol TCP
transmission control protocol is an
individual protocol now net buoy was an
individual protocol basically with tcpip
what this is is this a suite this is a
number of products put together uh to
give you the functionality that you need
so uh so if you're think about like
office functionality uh word is an
application Excel is an application
Microsoft Office is an office suite and
as we're talking about the protocol
Suite TCP transmission control protocol
basically what this deals with is how uh
the two devices actually communicate
with each other again nothing magic
happens in the technology World TCP is
what deals with that IP is the
addressing protocol so when we talk
about t uh TCP IP addresses
192.168.1.1 that type of thing that is
built into the uh the IP addressing
protocol uh and then you have things
like icmp and there's some other
protocols in the suite we're not going
to get into those a lot icmp is
important especially in the modern world
with all of these cyber Security Experts
out there that start turning off crap
they really should not turn
off don't turn off icmp unless you know
what the hell you're
doing any earned intern that turns off
icmp gets fired anyways what icmp is is
the internet communication communication
message protocol so whenever you do a
ping command um
uh clear so whenever you do the Ping
Command right so I do uh ping
CNN.com right so basically I'm pinging
I'm reaching out to this particular
server this is what's called an IP
address
151119 1995.5 that's where CNN is so I'm
pinging I'm saying hello and it's giving
a response back and one of the parts of
the response is interesting is actually
give something called latency right so
that tells me uh basically that I can
see see nn.com server and it's
responding I can also do something like
Ping
192.168.1.1 and so this is my router so
this is my router that connects me to
the internet and so I can ping my router
and I'm getting a response and you can
see the latency is a hell of a lot lower
it's 9 milliseconds or whatever else
right and so basically this is provided
to me through the protocol called icmp
that's part of the tcp4 protocol Suite
so here's one of the problems um so a
hacker a hacker can theoretically do a
ping sweep on your network what a ping
sweep is is it pings all the possible IP
addresses on your network to determine
what devices are on your network and
then they can collect additional
information you know from that right and
so that's very scary because if a hacker
can get in and do a ping s oh my God
something might happen so anyways what
happens sometimes is people decide to
turn off icmp right so in Windows I
think you can turn it off with firewall
software you can turn it off so
basically if you try to Ping anything it
will not respond because icmp is
disabled holy
hell do you know what it's like to
troubleshoot a network when icmp is
disabled do you know what it's like to
figure out connectivity
problems when you're not able to Ping
anything it it's a disaster it's a damn
disaster so anyways icmp is what allows
you to do things like Ping something
called trace route other things and uh
be careful I'm just lived experience
lived experience there's nothing more
miserable than troubleshooting
connectivity when somebody turned off
icmp uh but anyways uh if we keep going
up uh so we start looking at what a
tcpip address is right
oops see I'm waving my hands around
trying to keep you all awake okay so we
take a look at what an IP address
is and so what you'll see is an IP
address such as
192.168.1.1 so this is the address of my
router right now here's the thing that
address on on its own doesn't actually
mean a damn thing you also need
something called a subnet mask that goes
along with it right so what you'll see
is uh generally
255.255.255.0 so you have an you have
your IP address
192.168.1.1 with what is called a Class
C or a
255.255.255.0 subnet mask and so
basically what the subnet mask does does
is your IP address contains both your
network identifier and your div device
identifier so some of these numbers
relate to the host the computer itself
and some of these numbers relate to the
network some those routers are trying to
communicate to different networks they
need a way to identify the different
networks so part of that is the network
identifier so that's where the subnet
mask comes in so the subnet mask tells
you what part of this is the network
identifier and what part of this is the
the host or the computer identifier if
you have
255.255.255.0 basically what that
means is the first three numbers are the
network identifier and the last however
many numbers is the computer
identifier all right SO2 168 1.1 right
and
255.255 right so basically this is the
network this is the computer right you
may also see this as 1
192.168.1.1
sl24 so if you deal with the Cisco World
you'll generally see a slash something
sl8 sl16
sl24 right I'll show this to you in a
second what sl8 means is that is the
first number is a network identifier
what sl6 means is that it's the second
number
and the first number is the identifier
and sl24 means they're all the
identifiers then now you're sitting
there where do these numbers come from y
255 y 255 why do they call these things
octets why they're called
octets so when we have 1 19216
a1.1 these are four
octets what is an octet an octet is 1 2
3 4 five six
78 and so basically these positions
represent different numbers so doubles
so one so all the way on the right hand
side is 1 2 4 8
16 uh 32 2 64 and
128 right and so basically how you get
whatever number here is one right when I
look at that one what that is is I have
this is checked off here and then this
is z z0 z0 z z and that gives me one
right if I wanted I don't know 55 oh why
do I say words like that cuz I don't
know the actual answer um let's say I
wanted to address a
55 uh 64 is too big so that would be
32 uh 48 58 no that would be zero so 0 0
one uh we want eight so that gets us to
40 or no wait a minute sorry
oh so 30 okay so that give us to 48
that'll give us to
48
48 if we put that would get us to 56 we
don't want that so 40 8 + 4 48 + 4 that
that would get us the
52 and then we that would get us to 54
and that we get us to 55 so we're
getting trying to get the number 55 128
would be zero 64 would be zero 32 would
be 1 16 would be 1 8 would be zero four
would be 1 two would be one and one
would be one and this what the computer
cares about turns into that particular
number so we're looking at these IP
addresses generally what you'll notice
is you have IP addresses between 1 to
254 why have IP addresses between 1 to
254 is because if you add all of these
together right
so if all of these are zero I'm not
going to write it there but if all of
these are zero then that gives you a
beginning number of zero if all of these
are one
one then that gives you an ending number
of
255 so the total number of numbers with
an octet is you can to have between 0 to
255 but if that's the case why for IP
addresses do you have 1 through 254
because basically what you do is you
take 255 you take this number which is
256 possible numbers and then you minus
subtract two the first number is
considered what's called a network
address
and the last number is considered the
broadcast address so basically if
computers are trying to find another
computer on the network they broadcast
out and that is the address they would
broadcast it
out we cannot see what's written at the
top of the
board why can't you see what's written
at the top of the
board I don't know it's all
there it's called messy messy messy
handwriting I don't know I'm look I'm
looking at The Zo Zoom I see supposedly
what you see uh blame Zoom uh so anyways
so this is this is the number in scheme
so that's where you get to now the issue
with these uh with the subnet
masks is basically when you get into all
those
octets
so um I see you got a lot of cats uh 1 2
3 4 5 6 7 8 dot 1 2 3 4 5 6 7 8 dot 1 2
3 4 5 6 78 do 1 2 3 4 5 6 78 so this is
the IP address up here right and down
here we the subnet mask 1 2 3 4 56 78
dot 1 2 3 4 5 6 78 dot 1 2 3 4 5 6 78
dot 1 2 3 4 5 6
78 so
anyways you have some number up here
192.168.1.1 I'm not going to figure that
out anyways right so so this is
192.168.1.1 so the subet mask how it
work is a subnet mask is wherever the
ones end right so if I have one one one
one one one one one there for that first
octad what that means is that then is a
subnet mask that is the network part so
192 is the network part and the the rest
of it will be the host part right the
same way is true here if we have
1111111 all the way here right that this
is 255 this would be 25 5 so 0 0 then
that means
192.168 that would be the network
address and then the rest would be the
host address well what you can do is if
you're given wow somebody is coming in
an hour and 20 minutes in
anyways so what happens if you're
given a
255.255 network right so you're given a
255.255 network but you've got to create
a few networks for yourself right again
so basically let's say you have a
facility right and you have different
floors and so you want each one of these
floors to be its own network so you were
given a
255.255.0.0
network and so basically what you want
to do is instead of having all of these
possible IP addresses as computers what
you want to do is you want want to give
yourself let's say four I want four
networks with the rest to be however
many uh host IPS right it's called a
Class B Network so what you can do then
is uh be like 120 goes the other way so
basically what you can say is so this
would be one two probably four anyways
what you can then do is you can do that
and so you're G 2555
255.255 and then you're taking um Jesus
64 +
32 anyways you're taking these
numbers uh so actually figure that out
so it's 128
64 uh plus 32 uh 128 + 64 is 32 190
192 plus 32 is 192 + 32 is 194 224 uh so
what you can do is then you can have a
255.255
do2 what I say
32.0 subnet and so basically what you
can do then is the first numbers over
that way will be your individual
networks for each individual floor and
then on that floor you can have however
many hosts are left for all the
different devices on the floor um
this is a whole God aul class on its own
the important thing that you need to
know here is that the IP address is made
up of octets how you know the network
number from the actual host number is
with the subnet generally you'll have
either an a a b or a c subnet a is
255.0.0.0
which means that's the network these are
host B means that's the network these
are the hosts and c means that's the
network and these are host if you have
19 if you have a
192.168.1 dox
subnet so if you have a
192.168.1 x subnet so basically that's
255.255 2
55.0 what that means is you can have
between one uh addresses one to 254 so
in this particular Network 192.168.1 X
Network I can have up to 254 devices
connected to that particular network
with those IP
addresses I hope to hell that makes
sense don't worry with all of this stuff
as long as you keep coming to these
classes we'll we'll keep going over it
um when you start talking about these IP
addresses again every every uh Network
in the world that is connected to the
internet has to have an internet address
so one of the big problems is is if you
have all of these lands out there all
these local networks what happens if
somebody's stupid with their IP address
scheme what if right what if Bob creates
a
192.168.1 x Network and Tim an entirely
different location creates a 192.168.1 x
Network right basically is that going to
crash the entire internet because now
you have the same IP addresses again you
need unique identifiers so will that
crash the internet the reason it doesn't
crash the internet is because we
basically have what are called private
ipv4 address blocks so these are blocks
of addresses that are not internet
routable even if you configure a server
router any kind of networking device
with one of these IP addresses the
internet infrastructure will simply fail
it out it's like you're not supposed to
be here you're not a big boy go home to
your
land uh so this is where if you go to
your business's router or equipment or
your home router equipment this is where
you'll see these different address
blocks you might see 10.0 so that's a
popular uh internal address block a
private address block uh
192.168 that is you know that's my
favorite address block that's normally
what I use uh and then there's also a
17216 which is kind of funny CU for some
reason I have not seen that in like 20
years again it's weird in the technology
World simply because something is
technology technologically Works doesn't
mean people use it I see a lot of 10 I
see a lot of 192s I can't remember the
last time I saw a 172 block that's how
it goes so basically the idea here is
this gives you uh addresses in order to
build your network so a 10 a uh
oh a 10.0.0
10.0.0.0 block basically this is
10.0.0.0 sl8 so is a class a subnet so
that means everything past the 10 can be
used for hosts individual computers on
the network so theoretically that gives
you
16,777,216
hosts that can be on a 10. x network if
you use 172 not6
theoretically that could be 1,
14857 hosts on that particular Network
192 this is interesting I didn't
actually realize this they say 192 168
is a Class B subnet um so basically with
that you theoretically have a total of
65,536 computers on one single network
but if you see these particular IP
addresses they are private IP addresses
so if you go to digital ocean right if
you go to digital ocean and somehow you
spin up your little Linux box on digital
ocean and you go to manually configure
an IP address it shouldn't be any of
those or it's just not going to work on
the
internet uh let's see here uh switches
and ARP so let's go back to switches
again good old fashion switch so this is
a switch it's a buffalo switch power
over ethernet right so this is what
you're going to be connecting all of
your devices into whether it's a server
whether it's your desktop computer
whether it's a printer um whether other
networking equipment they all go through
switches basically this is the main Hub
Hub not a hub Hub uh that everything is
going to be going through uh the big
thing with this though is again remember
with a switch a switch works at Layer
Two IP addresses work at layer three
again nothing magic in the world happens
so we have to figure out how to make um
IP addressed Network IP addressable
networking equipment be able to
communicate over a switch and is where
we use something called ARP or address
resolution
protocol
arp arp doesn't come up a
lot learn it for the test and then
forget it until you realize it could
actually be useful for you so address
resolution protocol what address
resolution protocol does is it resolves
Mac addresses to IP
addresses anyways so basically what it
is is uh when you have your little
switch when you have your switch right
you have computers that are all trying
to communicate the computers want to
communicate with IP addresses 1
192.168.1.10 let's say switches want to
communicate with Mac addresses uh 0 a
colon 88 colon 44 colon blah blah
whatever all those are right so
basically what ARP does ARP address
resolution protocol it matches whatever
the current IP address of a device is
with the MAC address so if you have a
landan a local area network basically
what ARP is going to do is when your
computer goes out to communicate with
the other uh computers that are
connected to the local area network it
is going to get what their Mac addresses
are and then when it goes to try to
communicate with that computer in the
future it is going to be trying to
communicate through that Mac address
instead of Simply through the IP
address again switches have mac address
tables so your ho your host is looking
for 19 let's say your host here is
looking for
192.168.1.10 it's going to send the
communication that's going to go through
the switch whoever
192.168.1.10 is it's going to respond
with its Mac address going in the future
the communication is is then going to be
is your computer is then going to try to
use this Mac address to talk to this
particular computer and again that's
where you can get the caching issues of
what happens when the IP address changes
to something else but obviously the MAC
address doesn't change and then you can
run into some Curious problems uh but
basically when we talk about the the
this um clear now there's a command it's
called ARP a address resolution protocol
a and what this is going to do is is
going to give you the IP addresses and
all the Mac addresses for any
communication that this computer has
seen so that's also an important thing
that's not necessarily all the computers
that are on the network but all the
computers that this computer has seen so
we can see uh
192.168.1.1 it sees a MAC address of
this uh 1921 16816 see the MAC address
of this.
7.9 11151
17.21 and this is the broadcast address
and that's why you get the ffs right
there uh so basically these are the
computers that it's seen these are the
IP addresses that are mapping to this
particular Mac address this is where
hackers can get in if hackers are able
to get into your network and they start
doing things like cloning Mac addresses
again Mac addresses are supposedly
supposed to be universally unique if
some somebody makes it so that they're
not universally unique on the exact same
network fun and idiocy can um Can Rin
but anyways this is what ARP is ARP is
mapping the IP addresses to the Mac
addresses uh let's see here uh
okay only a few more then we start
talking about ports so again we talk
about TCP TCP IP version 4 so IP is this
IP address stuff right 192.168 subnet
masks that's the IP protocol TCP is
transmission control protocol this is
once the computers have found each other
right with IP and ARP and all that kind
of stuff then how are they actually
going to be communicating uh ports is
going to come up and basically what
these ports are is these ports think of
them as the doors in an office suite
right so think of it as the IP address
is the address to the building and then
the ports are basically the addresses to
the particular Services you want on the
building if you want to go to the mail
room email you would use the SMTP Port
uh if you're sending packages for
delivery that might go to the FTP Port I
don't know if you want to change the
thermostat you might go to the SSH Port
something like that right so these are
all individual ports so by and large uh
these ports are relatively standard for
most of the technology that you're going
to use uh SMTP something called Simple
male transfer protocol that will be at
Port 25 HTTP which you guys are using
obviously is at P 80 you never put in
Port 80 because your web browser
defaults the port 80 so that's it's
always there when we start doing these
projects in bottle so bottle is the web
app framework that we're going to be
using a lot for python many times you're
going to have to put in 127.0.0.1 that's
called the loopb address so basically
what that is is that's the internal
address for your own network card so
1.7. z01 you're going to do colon 8080
and the reason is is you're going to go
to that particular Port because port P
80 is protected and that's his own
disaster to deal with and so that's why
you do 127.0.0.1 port 8080 callon 8080
when we're doing those particular
projects https basically when you're
deal with things like SSL uses Port 443
FTP uses Port 20 and SSH uses Port 22 so
basically whenever you have a client
piece of software that's going to be
connecting to one of these different
Services they have to connect at these
particular ports that's one of the
reasons why you'll see people will turn
off certain ports right basically you
use a firewall so what a firewall does
is block ports so if you don't want
hackers trying to hack your Linux system
you block Port 22 so Port 22 is what is
used to connect to SSH and so basically
if it's open on the internet anybody can
try to Brute Force attack into it that
wants to if you block it with a firewall
then that simply that connection simply
doesn't happen you'll see this issue
with things like SMTP right so uh 15
years ago right U malicious email
servers became the cool thing to install
onto people's computers right so people
go out to their favorite porn site a yes
they do I had a computer repair shop I
had a computer repair shop and let me
tell you everybody looks at porn holy
hell
anyways and but one of the big things
back then uh is sending out spam and
email blasts right if you send those out
from normal servers it's easy to block
so one of the things that they were
doing is they were installing email
servers onto your computer to send out
the spam so that was one of the low
viruses or the the Spy the malware that
was put on your computer so one of the
things that the um that the isps did is
many times for residential internet
services they blocked Port 25 out
outbound so if you tried to send
communication on Port 25 outbound the
ISP itself would just block that crap
because they were tired of the spam
because you went to a porn site so one
of the things you can do is you can do
things like change that port and so that
was one of the big things that we had to
do a lot of times back then is you
actually change the smt port that was
being used into something else so that
you could get around those blocks again
Port 80 redirect uh there's something
called a port 80 redirect uh so again
also DL connections uh Verizon always
wants you to sell the $500 service not
the $40 service and so they were selling
DSL and a lot of people realized they
could run web servers from their home on
a DSL connection so anyways uh Verizon
was really irritated because they wanted
that $500 a month and S that $40 a month
so what they did is they blocked Port 80
right any inbound traffic on Port 80
would simply get blocked uh there was a
system that you could use back then
called a Port 80 redirect where if
somebody tried to come in at Port 80 it
would Auto redirect to a different port
that wasn't being blocked and then they
could get to your website so anyways
basically that's what we're kind of
dealing with with these ports is this is
basically the door number that's used to
gain access to whatever Service uh
generally these are configured by
default generally you don't with
them you just leave them how they are
but again that's why we're professionals
sometimes you you got to find uh out how
to do some interesting things uh this is
also when you take a look at these ports
one of the reasons you should be careful
about buying Chinese garbage I'm not
anti-chinese garbage Chinese garbage has
made the world what it is
today I'll let you figure out if that's
good or bad one of the problems with
Chinese garbage especially when it comes
to like computer like iot Internet of
Things
devices is yeah they don't they don't
budget for documentation
and so if you have this device on your
network that is communicating over some
ports and you have any amount of
security on your network it can be a
complete and utter
disaster when the device or the software
you're using doesn't document what
report reports it requires and so you
try to start getting working on your
network and that could be a bit of a
crap show so one of those things to be
thinking about so basically this is just
a door again these are there's there's a
lot you go through if you're going to go
get your network plus certification you
probably have to learn 20 20 of these
different ports at some point I memorize
them all at this point I just remember
Port 22 because I can laugh at
it uh so rouers and default
[Music]
gateways so you're going to look at your
computer so you're going to go to your
computer and you're going to pull up the
iuter add all right and so your IP
address is going to be
192.168.1 55 let's say so this is the IP
address for your particular computer or
it's 10.0 or 172 whatever under that is
going to be the subat mass so
255.255.255.0 right so that's saying
that's the network that's the host the
next thing that you're going to see
under the configurations is something
called a default gateway so for this
it'll be
192.168.1.1 what the default gateway is
is basically when your computer goes out
to try to talk to another computer
whether it's a print server whether it's
a file server whether it's
CNN.com right the first thing that it's
going to do right is connect it to that
switch and so the first thing your
computer is going to do is it's going to
call out to every device it can possibly
see is say hey are you
cn.com
CNN.com and all these people are going
to go
really really it's 2024 and you're still
using CNN.com as an
example anyway Legacy Legacy so all
these uh all of these computers are
going to going to give that computer a
frowny face so I can't believe you're
still going to cnn.com in 2024 anyways
because none of these are CNN.com and so
basically what the default gateway is it
is your router so what your router does
is it connects networks right so the
internal IP address is
192.168.1.1 that is the internal IP
address for your router and then it has
an external IP address and that's
basically what the internet sees the WAN
sees the internet sees whatever the next
step in this whole process sees and that
might be you know 204. 66120
anyways right so if you can't find
anything here what'll happen is your
communication will get routed to
whatever you state that default gateway
is and then the router will take this IP
address and then it will try to figure
out how the hell to Route so that you
can actually get to it again the
internet is basically a big mass of
networking equipment with a whole bunch
of routers and everything else and it
will
automatically get through the internet
and Order to get to cnn.com and Route
the traffic bank so when you look at the
default gateway this is the network
device either the router or the modem
that you have on your network that
basically more or less again for you
guys this is going to be the router that
connects you to the
internet right so one of the things
you'll notice here is again when we use
uh IP addresses you can only talk to
anything that's within your network
right so the
192.168.1 network is the only thing that
this guy can communicate with so you do
have to make sure this internal IP
address on your router matches the
network
number of the devices and then it's also
has a a uh oh a host number that folks
can communicate with right so if you had
this at 192
that doesn't match so these two devices
couldn't communicate with each
other hope that all make sense but
anyways that is basically what a default
gateway is uh depending on your network
you may have multiple default gateways
that's up for your design basically
communicates with any device that is not
on the land and this is essentially your
router or again nowadays you'll be
seeing your modems uh now what is a
modem uh so a router is a piece of
ethernet equipment
tcpip uses the ethernet standard as an
RJ45 Jack you plug in a c 5 cable so on
and so forth has a MAC address the whole
nine yards what a modem is is a modem is
a device that translates basically
different types of data communication
systems right so if you have cable
internet right and that
uses RJ 66
anyways you know that thick cable you
know Cable cable anyways basically what
a cable modem does is it transitions
from that that cable internet with its
protocols or whatever else into
something that ethernet understands
ethernet and tcpip so we go from the
Comcast world we hit the Comcast modem
and on the other side of it is DCP I4
with the EET standard uh fiber optic if
you if you have FiOS for rizon fi you
have your fiber optic modem that
translates their mess into TCP I4 and
ethernet if you use a 5G modem it
translates 5G into ethernet uh that is
basically all a modem is now again for a
lot of you folks if you're dealing with
small business small home environments
your modem and your router is going to
be one device uh but again depending on
what you're dealing with it may not
actually be one device especially when
you start dealing with business
situations
uh so then we get to
natat network address translation and
port forwarding so
natat is what killed
IPv6 IPv6 was all cool and it was all
sexy right it was the year
2000 we had survived the Y2K bug and
IPv6 was coming out strong and it was
going to take over the world
and then this thing called Gat came out
of nowhere and just popped it in the
nuts natat was ipv 6's 9-year-old little
girl came out of nowhere just crap then
IPv6 went in the corner and vomited on
itself so basically the thing is like
when you looked at ipv4 right we have
you know
192.168.1.1 and we have these octets and
we have these
subnets when you look at it I forget
exactly how many but you only have about
4 billion or so possible addresses you
can use with tcpip version 4 right so
tcpip version 4 came out in the
1970s and in 1970s they're like oh my
God four billion possible IP
addresses Make It Rain IP addresses is
there just giving away IP addresses cu
come out it's four billion 4 billion we
got so many IP
addresses anyways you know as things go
uh the internet got to be a little bit
bigger than they
expected again as with many things they
figured it would become obsolete before
four the four billion number was ever
gotten to and so what you'll hear about
is basically the depletion of tcpip 4
addresses is the idea is again think
about it all of the phones all of the
computers all of the Serv
that are on the internet especially at
this point in time are sure as hell
bigger than 4 billion well one of the
things you need to be thinking about
though is back in the 1970s iteration of
the internet when they were thinking
about the internet basically every
single computer that was connected to a
TCP IP network would have its own IP
address and generally an internet
addressable IP address right and the
idea was that it could all more or less
directly communicate with each other and
so the idea being then if every computer
has an internet addressable IP address
and there's only four billion of those
IP addresses then theoretically you can
basically only have four billion devices
on the internet ever
right well that doesn't really work out
too well so that's where you come up
with something called
net and that is Network address
translation and so what this is is
generally for your router or for your
modem that's where we have an internal
Network and then we have the internet
right so again
192.168.1 X Network right
255.255.255.0 so I have a
192.168.1 ex Network Bob has a
192.168.1 x Network Tim has A1 1921 98
1.6 Network right probably in your
neighborhood there's 20 192 161x
networks right so internal right you got
your switch or your Wi-Fi access point
uh this is
192.168.1.1 this is 192.168.1.2 this
192.168.1.3 and four and so on right
internally the internal IP address for
your router or modem is
192.168.1.1 I'll make that 10 the
external IP
address that is going to be
20366
44.1 so now what happens what network of
dress translation allows is when
192.168.1.2 wants to go to
cnn.com your router has not enabled so
when it goes out to the internet to
cnn.com and CNN.com responds that Nat
enabled networking equipment knows where
to send that Network traffic when three
goes to
fox.com let's be fair and unbiased here
we'll do Fox 2 right when three goes to
fox.com when the traffic from fox.com
comes back that network network address
translation device that net device will
then be able to send the traffic to
three so now instead of being limited to
4 billion Internet connected
devices we simply have 4 billion
internet um you know internet
addressable IP addresses connected to
networking equipment that has not
enabled and then below that I mean they
may have four billion you know devices
they figure out how to set that kind of
thing up right so basically underneath
this natat device you can have as many
networks and everything as you want um
and that's basically what natat does for
you
uh Matt Matthew Mony what's
up hey there yep um so youve got two
computers that both go to CNET yep sends
that information back to the internet
address the 253 whatever yep how does
the router know which CNN package goes
to computer a and which CNN data goes to
computer B in its internal
Network um basically because these are
these are going to be different sessions
so this has a communication session with
CNN and this has a communication session
with CNN so when it comes back in N
note gets hyper technical gets above my
pay grade for some of this stuff but
basically it it knows where to send it
so if you go to the about page and
somebody else goes to the prices page
you're going to get the about page and
they're going to get the prices page it
it knows where to redirect
everything um
so yeah basically that's where like like
on any network that you're on now again
everybody on your network is connected
to the internet they're all going to
their different sites and you're seeing
it all the information return to you
seamlessly you're not not you shouldn't
be noticing any any bugs or glitches
because Nat know knows how to route that
kind of
traffic no that's not a great
explanation but does that make sense
yeah yeah when you get into this oh
Christ there's frames and there's
headers and there's
packets I'm not going to teach you CCNA
today it's
[Music]
actually that's one of the big things to
understand about when you get into
computers especially if you're a new
person right one of the big things with
new people that you always hear from
noobs is there like Eli but I want to
know
everything and that's how you know
they're a noob cuz you're just not
you're just not
like all of this technology is built on
so many other components to get you to
where you are that if you honestly
bother to literally learn everything
theoretically from Soup To Nuts you're
not going to go anywhere again like you
you need to have a broad knowledge of
the technology world but at a certain
point it gets to obscure stupidity um so
yeah again there's there's packets and
there's frames there's headers with that
so so when you have the headers the
routers and N is able to read the
headers and understand where things are
going and where things are supposed to
be returned to and that gets into yeah
it's own
thing uh let's see here so what port
forwarding does right okay so let's say
I want to go to
cnn.com so my traffic goes out so this
is this is considered outbound so
outbound traffic my n enable device
tracks it comes to cnn.com and then
comes back in uh but the question then
becomes what happens if I have my own IP
address I have my own internet IP
address and I want to
run uh my own servers and I have all
these devices right so ever we talk
about ports right there's Port 80 Port
25 whatever else so let's say I have my
own uh server and it runs obviously at
Port 80 so basically what port
forwarding does is when somebody from
the outside world right inbound hits
your router and it says I want the web
server so in your router it's going to
have the IP address or host name for
your web server with that Port connected
to it so it'll be like
19
192.168.1
55 and that is where my web server is
Port 80 so any port 80 traffic that
comes in is going to get routed to that
particular server so we have routed to
that server that server then has the
website and then the traffic goes out
again so if you have an email server you
would port forward the port 25 to your
exchange server or whatever your email
server is if you have an FTP server
that's running your system you import
forward an FTP port to that particular
server the issue that you do run into
with this though is basically you only
more or less you only get to redirect
one port to one computer so what happens
if you have 10 web servers that are
running and they're all running at Port
80 and that becomes a Zone M that
becomes his own deal we'll get to it
maybe in a different class so think
about it with PK forwarding you have one
server offering one service within your
router you forward anything coming into
that port to that particular IP address
and then it's able to provide the
service to the
outside one of the things you do have to
be careful about in this modern world is
we have something called carrier net
which again like anything is fine as
long as you know it exists as long as
you know it exists so the problem with
carrier net is what happens when you go
through multiple
Nets right so you're looking at it and
you have an IP address so you're like I
know what my ex external IP address is
so I'm just going to point people at my
external IP address and do all this
whole poor forwarding what you do have
to realize is you have your little land
here right and you know 192 168 blah
blah blah and the external is
203
6425 blah blah one of the things
problems you can run into though is
especially if you get really low cost
ISP connections is you can have a whole
crap ton of
lands that are all connected right
essentially to the isp's router and
their router also has Nat it's a bigger
Gat it's like the Godzilla of gnats but
it's still Nat they have Network address
translation and so on their connection
you know might be like oh
17566 44.2 so although this is what you
may see as your external IP address or
even this is what you see as an external
IP address address if you set up port
forwarding right you say Port 80 should
go to because you have these multi level
net this is probably not going to work
out for you so basically what you would
have to do is their router would have to
redirect Port traffic to your router so
that your router can redirect traffic to
your server and if it's an
ISP they're just not going to do
that so do be careful with carrier that
now one of the things that I have done
in the past again in 2024 I would
question the value but I have done this
in the past is uh multi-level networks
right so there's something called a DMZ
a demilitarized zone so you have the
internet out here and then basically
what you can do uh is you have this
router and then under this router right
you have a switch and you have your
network well one of the things you could
do is you can connect the router you own
to another router you own and put
another switch under here and so
basically what this does is this creates
a multi-layer network so you have an
external IP address here of
20566
44.1 let's say in here right you have a
1
192.168 dot let's say 2.x Network it's a
two right and so this is is 1
192.168
do2 1 and then here we make this 1
192.168 do2 do2 let's say in here we
create a different network this a 1
192.168.1 x Network right so this is in
the class C
255.255.255.0 that's the network that's
the network that's the post so what you
can do here is I can forward P 80 to
192.168 do2 two so I'm going to forward
Port 80 to the external IP address of
this router this router will then get
that traffic that comes in within it I
can say I want to send all Port 80
traffic to
192.168.1.10 and so I have the 10 and so
then I'll get routed that way so again
with port forwarding you can do multiple
layers of this be careful the equipment
that you purchase is going to matter if
you buy Chinese garbage don't expect
this to work really well but again Cisco
net gear and again relatively decent
equipment you can actually do this type
of thing and forward through multiple
levels um but do realize again with
carrier they might be pulling this kind
of crap and if they are they're kind of
stuck
uh let's see here uh internet facing IP
addresses again basically that's what I
was talking about before uh so this is
what you will be dealing with if you
deal with digital ocean so if you go out
and you purchase your own VPS generally
generally speaking virtual private
server so again digital ocean Len node
it's called light sale on AWS whatever
else you go out and you get your
VPS virtual private server that is going
to generally come with its own inter uh
uh internet routable IP address so 255
or not two uh 204.
66127 I don't know whatever number it is
and they'll give you the rest of the
information the important thing to
understand is that this is directly
connected to the internet so all of your
ports Port 80 Port 25 P22 all of that is
directly connected to the internet you
are not worrying about nap you are not
worried about port forwarding because
there is nothing between you uh in the
internet so most of the time again when
you're trying to create things like web
servers if you want to spin up your own
WordPress site and you don't want to pay
like godaddy's WordPress service or
whatever you would go to digital ocean
you pay your five bucks a month for a
VPS you'd figure out how to install
WordPress you get that up and running
and then your your website is then
directly connected uh to the internet no
P forwarding or anything like that um if
you um
um uh go with an ISP many times with
isps you can buy multiple external IP
addresses it may cost you money
especially now in
2024 uh external IP addresses also uh
may be limited or they may simply not
sell them to you again this is one of
the things especially as a consultant
you're going to have to start thinking
about when you start talking to Comcast
for rise and the rest of these companies
is do not look simply at the price point
at the speed right how whatever speed
and agency they're offering to you also
look at things of can you buy internet
static IP addresses how many static IP
addresses can you buy so on and so forth
that might be very important to your
client most of your clients aren't going
to give a damn about static IP addresses
uh some of them will so it's just
something to keep in
mind uh firewalls uh so basically all
firewalls are is firewalls block TCP
ports right Port 25 for SMTP Port 22 the
important one for SSH so SSH if you have
not played with it uh basically all this
is is this is the remote Administration
uh Tool uh for administering things like
Linux servers you go in through the
command line and you can run command
line uh commands against a a remote
server and you're basically
administering it basically uses SSH and
so one of the things that hackers will
do is they'll do what so called a Brute
Force attack against your SSH Port where
they'll just keep sending username
password um combinations basically
trying to see if any of them work right
of one that's bad cuz maybe one of them
will work every once in a while that
happens and two that actually Burns
resources and the rest of it as your
computer deals with these these SSH
connections so simply connecting your
firewall to block SSH is a great way of
dealing with things again firewalls
something the things to be thinking
about with your
infrastructure as you hear about all
these hacks again things like ransomware
attacks and all that kind of stuff uh
when ad ad ministrators are grossly
negligent and they should go to jail in
2024 but that's its own deal uh one of
the things with firewalls is you can set
up firewalls so that only specific
computers can communicate on specific
ports right so let's say I have what's
called a database cluster right so
whenever you set up a database server
generally in a production environment
you don't set up one you set up a
cluster they're all communicating with
each other replicating data back and
forth so basically if any one of them
fails you don't have a major issue one
of the things you can do is you can put
them on their own
network right and basically you put a
firewall and router in between their
Network and let's say your web Network
so let's say you have a web server here
and what you say is only you know uh 1
192.168.1.10 let's say only the computer
at this IP address can communicate with
with his Network at these specific ports
you know at Port 1900 I don't know what
the database Port is right but anyways
you can say only
192.168.1.10 can communicate with these
database servers at this particular port
and any other communication will shut
down so right so if you got your little
Zimbabwean hacker right this Zimbabwean
hacker right parachutes in to your
environment plugs his little Raspberry
Pi into a switch and tries tries from
here from this level of the network
tries to compromise your database
servers well guess if you have a
firewall here that does not allow SSH
does not allow Port 22 doesn't allow
remote desktop Port whatever that is
doesn't allow any other
ports then even even if the the Zimbabwe
and hacker is here your servers are
going to be relatively safe from that
type of attack and so that's what that's
why firewalls are important now you can
have Hardware firewalls so again
especially if you're dealing with your
infrastructure again you have a company
a building you may have a a hardware
firewall that blocks specific ports
again you don't want certain type of
traffic uh to be coming into your
network that can be done uh but also you
can have software firewalls um Windows
has a software
firewall all I'm going to say is if you
try to deploy it make sure you buy a lot
of beer beforehand cuz it'll drive you
up the damn wall the basically what the
software firewall does is for your
server for the server itself you can
actually
configure for that server and you can
literally say which computers at which
ports are able to communicate with a
server either inbound or
outbound right so you can actually do a
firewall rule you can do a firewall rule
for what port 25 for sntp and you can
say Port 25 outbound simply is not
allowed on this particular box and even
if Zimbabwe and hacker is able to
compromise this box and is even able to
put an email server on this box when it
tries to send out at p 25 the firewall
the software firewall acts as a layer uh
to block that type of traffic from
happening so again if you have database
servers if you have web servers the
whole nine yards one of the things you
can do is you can set up the fire the
the software firewall to only allow
specific traffic to or from specific
hosts to prevent other types of attacks
uh from occurring right again even with
SSH right SSH you could say I only want
Port 22 to be available to address 1
192.168.1.5 so since you're the
administrator you set manually set your
IP address to this IP address and then
when you connect to that server at Port
22 it allows you to go through if the
Zimbabwe and hacker tries to Brute Force
attack Port 22 it just simply fails out
because they are coming from an IP
address that is different than this
particular one um so firewalls again
very important especially when you start
talking about this infrastructure again
platforms uh and again you have both the
hardware uh and the software uh Windows
has a window uh software firewall built
into it God help you if you try to use
it maybe it's gotten better maybe it's
gotten better I don't know uh Ubuntu
Ubuntu has software firewall built in
called
ufw uh which is actually very very
useful and very good and so it is
something that you should think about uh
one of the warnings that I will give you
uh with setting up firewalls especially
software
firewalls is BU build your platform and
test your platform without the
firewall in a testing environment turn
off the damn firewalls because again any
communication over this port right that
is all going to either work or not work
based off of how you configure the
firewall so you could configure This
Server perfectly This Server could be
like the Mona Lisa of
servers but you fat finger something on
the
firewall and nothing's working properly
and then you rip apart your server and
you lose your mind right so the thing is
what I would recommend with the software
firewalls is you get your servers up and
running you make sure everything's
communicating with each other how it's
supposed to communicate and then you
start adding those firewall
configurations so that if some if
something breaks after you already know
it was working it's really easy to go
back and change a firewall
configuration if you get what I'm saying
there oh let's see here then we have DNS
domain name
service DNS is then how we um resolve
fully qualified domain names uh to IP
addresses so again I've been talking
about all these IP addresses and again I
I can't keep us straight
192.168.1.1
192.168.1.2
10.0.1 556 no that doesn't work 200
anyways right humans humans don't go do
good with IP addresses right what we do
get do good with is
CNN.com when in doubt always go to
cnn.com it's good for a laugh anyways
right so I can remember CNN.com I'm not
going to remember whatever it is
15166 44.2 so this is where DNS comes in
so what DNS does is you resolve fully
qualified domain names to IP addresses
so basically you have your computer down
here um you have your router you have
the internet and then CNN.com is over
here really
15166 44.2 is over there right so what's
going to happen is your computer
essentially is going to go and it's
going to communicate with the DNS server
it's going to communicate with the DNS
server and it's going to say what is the
IP address for for cnn.com it is then
going to get the IP address for cnn.com
it is then going to communicate through
the router through the modem up into the
internet then it's going to go to the IP
address for cnn.com the server is then
going to see that you're looking for
cnn.com and then it's going to send back
via the website to you and so basically
all DNS is is resolving what are called
fully qualified domain names uh to IP
addresses how this system works is a lot
more complicated we're not going to get
into all of it today but you should do
know some very basic steps of it so
basically when you're at your computer
right when you're at your computer and
you're trying to go to
cnn.com the first way that your computer
is going to try to resolve that IP
address is by going to something called
the hosts file so there is a file on
your computer on all of your computers
called the host file this is a text file
just an ask you text file and in that
ask you Tex file basically it has
something like
CNN.com and then it has an IP address
20566
44.1 right so the first thing you try to
go to cnn.com the first thing your
computer is going to try to do is going
to try to go to the host file and so
this was a major attack Vector again 15
years ago right the Zimbabwean hackers
would get into your computer they would
modify your host file so that when you
when you try to go to
cnn.com instead of going to CNN.com you
went to but plugs are us right because
basically what they did is they got into
your host file and instead of having the
appropriate IP address there they put in
you know
10866 44.1 that pointed to but plugs are
us and so when you try to go to cnn.com
you got it routed to their server
instead so anyways that was one of the
vectors for attack in the modern world
not so much of a vector for attack
anymore because thank God we actually
protect our host file operating systems
learn hey protect the damn host file
thank you why this might be useful for
you though is if you're trying to build
your own web application so let's say
you're trying to create dog a dog dating
map right you have
dog dating you know
app.com now here's the thing right
you're playing with it you're new you
don't want to worry about hackers or
anything else you don't want to pay
digital ocean and so basically you want
to run dog dating app.com on your
computer so your computer right the loop
back address is 127.0.0.1
so one of the things that you can do is
in the hosts file you can say dogda
dating app.com points to
127.0.0.1
and so when your computer tries to go to
dogda app.com it will simply loop back
on
itself and it will go to that bottle app
that you have running that web app frame
framework uh so you can start seeing how
dog dating app will work without
actually putting into the real world so
that's one of the reasons that host file
might actually be used again from a
security standpoint too one of the ways
a host file can be used from a security
standpoint is if you go to your client
computers and you make
YouTube resolved at 0.0.0.0
every time any one of your users tries
to go to Youtube it'll try to go to the
IP address 0.0.0.0 that does not
actually exist and so they will not get
to use YouTube and they see the nice
part about doing this is they'll think
it's YouTube's problem not yours here's
the thing if you put if you put um
security mechanisms on your network to
say this is not allowed by your
administrator then your users will hate
you if you configure it in such a way
that it just fails without implicating
you and the
failure then you know when the work
order comes in when the trouble ticket
comes in you go yeah I don't
yeah Bob I don't we we don't really know
what's going on with this whole YouTube
thing yeah we've gotten a lot of
complaints people haven't been able to
get to youtube.com I don't you know our
Network seems to be working well you
know we've really been working on the
latency so so Bob we are going to keep
trying to figure out why
YouTube is failing uh to provide the
video Services you're looking for yeah
but we we are on
it honesty you
know I never said I was a good Buddhist
never said I was a good Buddhist so
anyways you got the host file so you got
your computer and you got your host file
above your host file for DNS resolution
is generally going to be what's called
your Soho router your small office home
office router so that's going to be your
net gear that's going to be your lynus
whatever the hell right in there is
generally going to be DNS the thing with
the DNS in this this router is it's not
only going to be uh for the internet for
google.com and CNN.com and all that kind
of stuff but it's also going to be for
the names of hosts in your system right
so if you have a computer called mail
server right it will have the IP address
192.168
5524 or whatever if you have FTP server
192 168
5522 right it will have right your this
local pns server will be able to give
you information for the outside world
and it will be able to give you
information for your local devices this
is important because what a lot of
people do in their configurations is out
on the internet they realize that
whatever um DNS server that they have
configured in their system is some kind
of ISP crap right uh so Verizon was
really bad with this right so you would
go and you do you would do a query for a
website it would fail and in variz and
would feed you ads instead of giving you
a good result so one of the things you
may do is you may go to like Cloud flare
so I think cloud flare their DNS Serv is
1.11.1 right well here's the thing if
you go to Cloud Flare's DNS server if
you configure in your computer Cloud
flares DNS server when you try to go to
cnn.com your computer look at the host
file it will then go all the way up to
1.11.1 to try to resolve to cnn.com but
that's going to work fine for you that
that's going to be Splendid and there's
no technical problem with that but
here's the issue what happens if you
want to connect to a local
computer for DNS
1.11.1 does not have any idea what the
uh the names are the host names are
within your internal Network so when it
try to resolves the internal names in
your network it's going to fail so
basically what
happens is
setup is you have your computer that has
a host file you then communicate with
your local DNS server right so you
configure your DNS to
192.168.1.1 so that's probably your
router within your local DNS server you
then configure its DNS server
1.11.1 and that thing communicates up to
1.11.1 so right so basically when you
plug in in a name here it'll go to the
host file if it resolves there it stops
if it doesn't resolve it goes up to your
local DNS server if it's a local
computer let's say the file server it
resolves and then you stop if you're
trying to go to
cnn.com it will then go up to 1.11.1 it
will resolve for
cnn.com and then basically it'll stop so
this is kind of the layer of how DNS
resolution works on an exceedingly
exceedingly basic level um but again
this is one of those things to conf
think about configuring when you're
configuring your um your infrastructure
the big thing for you especially if
you're going to be new coders is to
really look and start playing around
with that host file because that can be
incredibly valuable and you don't need
to own the domain name right so you
could you can be like I hate
CNN.com and you could literally plug
into your host file CNN.com or whatever
to resolve back to you for your dog
dating app right because because when
you buy some CNN.com you're buying it up
there on the at the internet
level if you configure it down within
your host file you can do whatever it is
that you want with
it the final part of this is there is
something called reverse DNS and what
reverse DNS does is it resolves uh IP
addresses to domain names all right so
DNS resolves domain names to IP
addresses but the question there is what
happens if somebody CS or compromises
the system what reverse DNS does r DNS
does if you have it set up within your
infrastructure it's it own big deal is
once you get back the IP address it will
then check whether what the IP address
matches to and whether it matches to the
domain name that you're trying to go to
so if somebody compromises either host
file the DNS server reverse DNS right
you get that IP that that nefarious IP
address what reverse DNS does is it
takes that IP address and then tries to
resolve back to a domain name if that
doesn't work out the communication
fails then we get the
DHCP DHCP is dynamic host configuration
protocol words so many words we got uh
and basically this is what is used for
what are called Dynamic IP addresses uh
so generally whenever you have your
server whenever you have your networking
equipment on your network you're going
to give them static IP addresses right
your router should be
192.168.1.1 should be
whatever1 networking equipment should
then be2 3.4.5 printer should be101
111125 server should be 20.5 whatever
right just you you give them a static
number so they're not all floating
around grabbing Dynamic IP addresses uh
the issue though is is like what happens
when you have your office and you have
people coming in during the day right
especially you have salese remote
workers that type of thing if you only
have 254 addresses and you have people
that are constantly coming in they're
constantly coming in and they're
constantly leaving if you try to
statically assign addresses to each one
of those people it's going to become a
colossal pain in the ass so that's why
you have
DHCP so what DHCP does is it allows to
dynamically assign IP addresses to the
computers that are connecting to your
network so you create what's called a
scope so again so we have the 1 n oops
2.1
68.1 dox Network right so in that what
we might say is we want to scope between
100 to 200 so basically we want
addresses
192.168.1.100 to 192.168.1 not 200 to be
part of this scope and they are able to
be dynamically assigned uh to whoever
basically plugs their computer into the
network and they're able to grab that IP
address pretty simple uh with these IP
addresses you get something called a
lease length so basically when the IP
address is assigned by the DHCP server
it also gives it a lease length before
that address expires essentially what
happens is as the computer is connected
to the network every once in a while as
you communicate with the DHC c p uh
server uh to renew its IP address
basically to renew uh the lease on the
IP address that it already has if it
does not renew the lease on the IP
address at a certain point that IP
address will expire within the DHCP
system and then it will reassign the IP
address over to another
computer this is where you can run into
some weird freaking problems especially
in the remote work world where you have
a computer that hasn't connected to the
network in a month you have another
computer over here this as. one
.11 right this is already locked into
this computer but it hasn't been
connected to the network so it's kept
this IP address DHCP has expired that IP
address in its database handed that over
to another computer and all of a sudden
when you connect your computer to the
network that's where you get this flash
to say that IP address is already on the
network if you have a modern operating
system your operating system just deals
with it you don't really get anything
much more than the error if you have a
crappy operating system stupid stupidity
ensues stupidity ensues but anyways
that's what you're dealing with with uh
with DHCP uh generally um you want any
of your infrastructure servers
infrastructure equipment to have static
IP addresses you statically assign them
an IP address and then that's what their
IP address
is even with the statically assigned IP
addresses one of the things you have to
think about in your code right when you
are writing your
code is you do not want to hard code
code IP addresses into your python code
because what happens if somebody needs
to move the server to a different IP
address what happens if the IP address
scheme
changes and what happens is if this was
the first part of 50,000 lines of code
you've written over the past five years
and you hardcoded the IP address into
everything uh basically one of the
things that you want to do even when
you're using static IP addresses is you
want to make sure that you're pointing
to DNS so basically you're pointing to
um fully qualified domain names host
names so instead of pointing your python
code to
192.168.1 55 what you really want to be
pointing it to is to you know app server
so app server currently resolves to this
but if for some reason the app server
needs to go over to a different IP
address you simply change the IP address
within DNS however you do that and then
all of your code still works perfectly
when you're writing your code write code
for DNS names not for IP
addresses unless of course there's a
specific reason you're going do for the
IP address but that is own too
uh let's see any questions no so far uh
VPN so virtual private networks these
are
cool um so basically virtual private
networks are something for you folks to
be thinking about is the old school way
of using them isn't so cool you probably
should not be using old school
vpns uh but basically what a VPN is is
it's a tunnel that allows remote
computers to logically interact with a
local network right so you have
you have your uh your facility and in
your facility you have your email
servers and you have your file servers
and your print servers and so on and so
forth so anybody that's in this facility
gets access to all these things so vpns
were very important before the days of
Gmail back when we used Outlook remember
when Outlook was sexy remember being
Fanboys over were Outlook anyways with
Outlook you had a client that was
installed onto your computer and it
would try to directly communicate with
your exchange server at specific ports
we didn't have these fancy web services
at the time again I still remember when
software as a service we were all like
that's an interesting idea so Salesforce
tell me about
Salesforce anyways right so basically
the idea is if you had you know your
person that's out with a computer and
they need to be able to get access to
email service or whatever else that they
they need to somehow tunel into the
network to be able to act like they are
on the network itself that's what a VPN
does basically what a VPN does is it
creates an encrypted tunnel so it
creates a
tunnel and then within that tunnel it
sends and receives encrypted traffic
this tunnel is actually important this
tunnel is actually important especially
if you're in crappy cities like
Baltimore the reason the tunnel is
important is because one of the ways
that vpns try to protect themselves from
hackers is if
they if the VPN senses that the tunnel
has been compromised it collapses the
tunnel and recreates the tunnel right so
when you're dealing with the internet
and you're sending traffic through the
internet the traffic going through the
internet is a lot like a drop of water
on your hand whenever you put a drop of
water on your hand in the exact same
place it'll go into a different
direction right depending on current
conditions globally on the internet your
traffic may do a whole bunch of weird
ass things get from point A to point B
so the idea is that you create a tunnel
from where you are back to that home
office if it detects any kind of
compromise in that tunnel so remember
your traffic is encrypted within the
encryption so you have the encryption
tunnel and the encrypt so if somebody
tries to come in to grab the encrypted
traffic it will collapse that tunnel
and then try to get it recreated down a
different path so the idea is you can't
have a man in the middle attack because
every time it it it sends it as a
compromise it recreates itself so it
goes into an entirely different roundout
which is great which is great when you
have first world internet connections
it's beautiful uh when you're in
Baltimore
City and and you have uh copper lines
that have been there for a hundred
years right again what is what is what
is a failure what is what what is a hack
right it's it's all it's doing is is
sensing values so if you have really
crappy copper lines the values coming
over those really crappy copper lines
are going to look like somebody's
compromising the system so one of the
problems you can have again if you're in
Baltimore and I dealt with this is
basically every time you're connecting
the VPN it keeps freaking dropping and
recreating itself because some Cricket
somewhere hiccups and uh you know it
sees that as a hacking attack so anyways
so that's basic basically the idea with
a VPN uh the issue nowadays why you
should not be using vpns this is a bad
idea no no no no no no no is because if
a hacker is able to compromise the user
credentials literally they're able to
sit at their computer and act like
they're on your own internal
Network again good architecture for 2004
is not good
architecture for 2024
why this becomes important for you as
coders is because vpn's now again that's
not generally how VPN are used anymore
vpns are now used nordvpn tunnel bear
whoever else and the idea uh that a lot
of people are using a VPN for are
essentially to get around rules and
restrictions right so if you have
Netflix uh so Netflix um basically has
Regional restrictions uh if you go to
Europe you're able to view things that
are different than what you're able to
view the United States different that
you're able to view in Asia and the
whole nine yards a lot of this is simply
based off of your IP address your
external IP address is matched uh to a
location within a database and so if
you're in the United States and you try
to get to Netflix searching videos you
will not be able to get so the idea with
a VPN connection is you create a VPN
tunnel to you know
Italy and then when you try to go to
Netflix what's going to happen happen is
Netflix is going to read the IP address
from here so your external IP address is
I don't know
20466
55.1 when you come out of tunnel Bears
system uh their IP address is going to
be
10155
26.2 so basically what's going to happen
is Netflix is then going to read this
it's going to read the location is Italy
and then you are going to be able to
bypass those Regional restrictions
because your IP address is coming from
Italy it's not coming from the United
States and so that's one of the things
that the vpn's can be used for now and
again it's one of those things to kind
of uh consider whenever you're designing
your platform again when you're creating
a dog dating app there might be reasons
that you want to restrict you know the
locations that that your your service
can be seen from you see this with porn
nowadays uh so porn is very interesting
porn is
fascinating for reasons that have
nothing to do with boobs um there's a
whole lot of laws and things going on
right now again with the porn world
again where the idea of where
where literally and this is the thing to
think about where does the porn
transaction actually occur right there's
a lawsuit years ago where uh Alabama the
Alabama attorney general tried to Sue
this porn company because people in
Alabama were viewing porn from the porn
company and this porn company for
whatever reason was
illegal well here was a thing the porn
company and the porn servers were in
California the people viewing the porn
were in
Alabama the Attorney General's legal
abilities end at the Alabama line so
very interesting question
occurs is when somebody is watching porn
where where does the transaction take
place if the person is connecting to the
California server and the California
server the transactions happening in
California then California laws
stipulate how that porn is dealt with if
the transaction is seem to be occurring
in Alabama then the Alabama laws are
where the transaction occurs and the
legal should be dealt with
and this is why I say if you really want
to be successful in technology today you
should go get your jurist doctor because
this crap is going to be far more
interesting than TCP ports in a little
while but why this becomes even more
interesting though is what happens if
somebody purposely circum events the
systems that you've put into place again
we see this with with Brazil right now
uh so Brazil is blocking Twitter if
Brazilians use PPN to access Twitter
they could they could theoretically be
penalized for it but again think about
this again we just had the telegram just
had the telegram CEO arrested right
telegram he's not a res he's not a
resident in France telegram isn't in
France the whole nine yards but France
is arresting him for breaking French
laws because of how French users are
using it now one of the things you could
say is well well you know with my with
my uh with my python code I'm going to
write python code to
geoblock anybody from any country that I
don't want to deal with right I'm an
American I'm an American company I don't
want to deal with those fers fers be
crazy I want to do a fers so I'm just
going I'm just going to create this Geo
block you know very basic so that only
Americans are able to access my
platform what if a French person uses a
VPN to access your
platform where is that transaction
occurring who is liable for the possible
criminal
offense if there's they're able to
access your platform but you created a
system to try to prevent them from
accessing your platform but there's a
pretty easy workaround to get around
that
system welcome to the next two decades
whether Tech world is going to be like
again things to be thinking about
uh let's see here um and command line
tool so just some things to look at when
we started talking about um you know
tcpip and
um uh tcpip and uh programming and that
kind of thing again one of the cool
things with uh with um python is you're
able to interact with the operating
system level tools so you do not have to
recreate tools and order to get the
functionality uh there's some simple uh
command line tools that you can use uh
these will work on Linux they will work
on Mac if you're on Windows they'll kind
of sort of work you know you use Windows
uh so we got ping um so ping is very
useful again for uh determining
connectivity right so you're sitting
there can you communicate with a server
so one of the things you might do is you
can ping CNN.com all right so I want to
Ping cnn.com
so notice with Linux or with Mac if you
do the Ping command it will continuously
ping until you tell it to stop that's
why in the code you always do hyphen c
space one for count of one but anyways
right so we ping CNN.com we see that
CNN.com resols 151101
67.5 and we see that we're getting the
responses back so something to think
about as a coder right you deploy your
server you create the the domain name or
whatever for the server and people are
not able to access it for some reason
one of the things you might want to do
is Ping that domain name and verify that
the IP address is resolving properly
right maybe maybe again you've been
doing a lot of testing you had one IP
address now you have a different you
modified you change the IP address and
for some reason within the system you're
still you're still uh resolving to that
old IP address that's one of the things
you can do for troubleshooting purposes
uh if you can get the IP address so if
you're doing CNN.com for some reason
it's not resolving properly if you know
what your IP address is you can ping the
actual IP address
itself right so you know ping now let's
do
192.168.1.1 right so I can ping that you
know that's my router so I'm simply
doing this and then verifying that I can
actually see my router now you know
somebody hasn't pulled out the network
cable again there's something called The
OSI model we'll talk about the OSI model
in a different class there are seven
different layers the first layer is
called the phys physical layer and
basically as they say in the networking
world 99.99% of all problems are layer
One problems and what that basically
means is somebody unplugged the damn
cable why can't nobody get to my
server is the cable plugged
in oops yeah anyways so simply pinging
you know the devices or whatever is an
easy way to do that uh you have the ARP
tool again the ARP tool is interesting
uh we're going to use it today in one of
the labs and basically with the ARP tool
does is this gives you the AR table the
address resolution protocol table uh to
show all of the computers with the Mac
addresses that your
um oh that your computer is seen so this
isn't necessarily on the network this is
at this point in time what your computer
has seen so 1921
16816 has this particular Mac address so
on and so forth so again if you're
coding doing network monitoring
utilities that type of thing that might
be useful for you uh there's something
called tra trace
route trace route can be very useful so
trace route route to
elithecomputerguy
and basically what this is going to do
is it's going to show me all the
Hops right so so we talk about the cloud
and we talk about all those different
Hops uh that that you have to get to
again we talk about that route uh what
trace route does is it tries to show you
all of the routes uh so basically I I
resolve eluter gu.com to 50621
18629 um the first the the first top
that's going to go through will be
17218 12.1 that'll be for my ISP then it
goes to 64 then it goes to Edge
dedicated router then it goes to a
different router then it goes to a
different router it goes to a different
router a different router goes to a
different router goes to a different
router and basically this is a way that
you can try to determine basically how
the traffic is actually routing uh to
get from your computer to whatever
server or device they trying to
communicate with uh this can be very
useful again if you got a Wan so you got
like an internal like web app
infrastructure something's not working
properly you can use something like
trace route and what you might find is
there's some kind of break or the
communication is going in some kind of
wonky Place uh you'll notice at some
point generally when you try to Ping
anything on the actual internet you'll
start getting these hops with blanks
back and and this is because icmp is
blocked so basically all of these
routers and pieces of network equipment
have decided they're fine with you
knowing what's going on these will
generally be your
ISP uh but then again because they're
worried about Zimbabwe and hackers got
to worry about those zimbabweans right
uh they don't necessarily want you to
know information about these other uh
pieces of networking equipment you're
going through and so basically icmp has
been turned off and so you do not get
responses back so if you use trace route
you'll get a certain amount of
functionality from that uh and then
finally um if you're using Linux you can
use the IP space address command if
you're using Windows you can use the IP
config command uh with
um with basic uh Mac you can use if
config and this will tell you some
information about your internet
connections uh so these are all the
different internet connections or
network connections I'm sorry that um
this particular computer has and you can
scroll through to find where your IP
address is so many things
so so so many there we go so my IP
address here is
192.168.1.5 uh gives me mac address give
me some other things here basically I
can use that as command line tool just
to see some basic information and again
with these command line tools there's a
lot of cool command line tools we're
going to be using command line tools
there something called inmap that's
actually a tool that allows you to scan
a network get a lot of interesting
information U but basically these are
all here so you can do some of this kind
of troubleshooting uh stuff at the tcpip
layer uh were these vpns common for
remote work uh yes vpns were common for
remote work um
until they became a bad idea so back uh
again 200 uh
2002 2002 I worked for a major
corporation uh that was in the the
Baltimore Virginia area and um Comcast
one day decided that they were going to
block what was called VPN pass through
so again all this stuff nowadays just
works you don't have to think about it
anyways there's actually a specific
service that has to be on the router for
VPN traffic to be able to go through it
it's called VPN pass through and for
whatever reason Comcast just decided one
day that residential clients shouldn't
get VPN passed
through holy crap 2002 our help desk
blew up as all of our remote workers I'm
sorry 2002
telecommuters uh could no longer access
the systems that they needed to access
and there is nothing quite so amusing as
watching to help desk employees try to
fix a problem that nobody in the office
is able to fix um so yeah so yeah VPN
VPN was the thing U really until
software as a service U became prominent
so when Salesforce became prominent when
Gmail became solid for business use
Office 365 that's generally when V uh
when when uh vpn's more or less died for
this particular purpose but you have to
remember like back when I worked in the
Enterprise right our
salespeople we had a local server that
had our CRM solution so we used
something called act back in the day uh
so that server had the ACT database the
only way to connect to the ACT database
is if you had a local connection so
either had to be in the office or you
had to use a VPN again when we used
Exchange Server Exchange Server only
allowed you to send and receive emails
and do all the rest of that fancy crap
uh if you were actually connected to to
your to your offices uh Network so you
had to use a VPN for that right so again
you go back to the 20012 2002 time frame
you got to understand like like
literally literally I remember when
Salesforce came out and people were like
huh what do you think about
that and uh and we all fig found out
what we think about that it's a pretty
good idea so basically that's the thing
is with Salesforce with Office 365 with
all these uh these um software of
service you just simply don't need the
connectivity that you used
to okay so before we get to the labs we
have labs for today so you can Tippy tap
type if you want to any God help me any
questions on what we've talked about up
until this point in time it's 4:43 this
has been a long class any questions
anybody
awake give me a thumb up if you're awake
how many thumbs up do you think I'm
going to get we're going to have a bet
here on how many thumbs up we get three
got three four five six
seven
eight okay I've got eight nine oh you're
awake people are awake no questions nine
people are awake and still no questions
fair enough fair enough we will uh go to
the labs uh yeah so we have uh actually
have four Labs today just because they
are relatively easy uh we are going to
use a rest AP I to find the vendor for
our Mac address uh we are then going to
do a dump of our ARP table and then we
are going to Loop through uh we can
basically get the vendors for all the
Mac addresses that we have in our Ark
table we're then simply going to do a
little ping tool and then we're going to
do a ping Loop tool these ping things
are basically if you've been follow if
you've been doing these classes before
you know I like my ping you know I like
my ping apps they're basically like
we've done before slightly different
anyways let's go and take a look at that
this so this is going to be using uh the
request module so you do have to install
the request module Python 3 space hyphen
m space pip install requests and that
allows you to interact with URLs
interact with web pages we're going to
be using a site called Mac vendor
lookup.com that's what I showed you
before and basically all this is is this
is a rest API database that'll basically
try to give you some information about
your Mac addresses uh so
what you're going to do is again you can
copy all this and you can copy this Mac
address it doesn't really matter so
import requests Mac equals so Mac
address equals and a MAC address so
we're going to do try so we're going to
start using try accepts so try accepts
this is where you try to do something
and then if it fails you do something
else kind of like if else only for
actually taking actions right so we're
going to do try so response equals
request.get F string then we're going to
do whole API call we're going to do
since it's the F string we're going to
put in the MAC
address and then we're going to use the
Json method here to turn that into Json
so you can actually parse it except
basically if this doesn't work for
whatever reason we're going to say mac
address not found we're then going to
print out the entire response that we
get back here so you see what that
response is and then we're going to
parse just the company so we do uh print
F string we do double quotation marks
because we got to get the uh the company
thing in there company colon and the
response index zero index company it's
got a print out so if we run
this oh basically what we see is
initially this is the full Json response
again if you're going parts of Json
response notice this opens up with a
square bracket so there's only one index
in there but you got you've got to deal
with that Index right so that's where we
have the zero here response zero so we
open and then we come here with start
hex so this is the start hex this the
end hex star end then we have company so
this is coming from Apple Incorporated
and address for the company is this
address country is us and then we do
company and says it's from Apple right
so it's a very easy way you can kind of
try to see the devices that you computer
sees and what the vendors are and that
type of thing uh pretty simple shouldn't
be too many issues with it basically
just a pretty crappy little rest
API uh this one gets to be a little bit
more interesting a little bit more
confusing uh basically what this is
going to do is we're going to dump our
ARP table and then we're going to parse
it so there we
go okay so this is going to print out
multiple things and you can get rid of
some of it if you don't want to for
troubleshooting purposes so the first
thing that we're going to dump out is so
we're going to get all the records from
our AR table and we're going to turn
that into a list so this is all the
records from the ARP table and we turn
it into a list again that's that's where
you see the comma so this is index zero
that's index one index two so on and so
forth so that's all of it we don't
really want all of it because again if
we're if we're going to be sending
values to a rest API we need just what
we need so from this we're going to get
a list of just the Mac addresses so this
is just the MAC address here once we
have a list of just the Mac addresses
then we can simply Loop through that
list using that rest API call that we
did before and then we're simply going
to do the Mac addresses and then we're
going to print out right so you know
colon 68 is Apple colon DC is ring colon
D5 is ring colon E5 is Nintendo I got a
switch I don't know why my switch is on
at this point in time but I guess it's
on right to see is apple right so this
this shows you how you can get some more
information about your network with a
pretty simple
utility uh so we take a look at this
we're going to import OS that's default
import request you do need to install
request response ARP equals os. poop ARP
space- a. readlines so what this does is
this sends a command to the operating
system and then sends the results back
to this variable the command we're going
to send is arp space hyphen a so this is
basically just dumping that ARP table we
I then do the read lines method here so
basically this object that comes back I
want to turn every line into a value in
a list so response uncore ARP that is
now going to be a list and when I
printed the list that's going to be this
so that's going to be that long ugly
thing it's going to have the IP address
it's going have the MAC address have
some other
information so one of the things I'm
going to do here is that I want to clean
up the list I'm not using red deex for
this red deex is called regular
Expressions that's its own fun we're not
going to get into regular Expressions
yet so basically I need to find a way to
pull out just the Mac addresses how do I
pull out just the Mac addresses right so
if I go here and uh CA I do
ARP so basically each
line is a value in the uh in the list so
what I'm going to then do is I'm going
to use a split method and so what I'm
going to do is I'm going to parse each
line so for each line in the list I'm
then going to turn that line into a list
I'm going to use a split method and I'm
going to say wherever there's a
space I want to turn that into a value
in a list so the IP address will be an
index zero at will be a one uh Mac will
be a two on three four five and six so
this is now going to be a list split on
all of those and then basically what I'm
going to do is I'm going to then read
through that new list that I've created
and if the item in that list as I Loop
through has a colon in it I'm going to
add it to my new Mac address
list so this is a list I go to the
record I turn this into a list I Loop
through that new list that I've created
if the item has a colon in it I add it
to my Mac address list if that makes
sense so that's where we come here again
pretty simple on code so we're going to
create macore list we're going to make
it a blank list for line in response
uncore R so for each line host equals
line.it and I'm going to split so it's
it's a single quotation then a space
single quotation so I'm splitting on the
space and then for item in host it's
going to Loop through each one of those
items if there's a colon in that item
then I'm going to Mac list
append that item to Mac list and that's
what's going to give me just that list
of Mac
addresses then basically that's where we
print out just that list of Mac
addresses now that I have just a pure
list of Mac addresses I'm going to Loop
through that for host in Mac list again
we're going to try try so we're try
response equals request. get here's our
rest AP rest API call host. Json and
then I will print out if this works I'll
print out the host uh hyphen response
zero company so it'll be host Mac
address and uh whatever company Apple
ring or whatever if this fails response
equals not found so it'll do print host
hyphen response so I host not found and
that's where you get the results so
that's let you go through
here
again this is the first mess then we
clean that up to just a list of Mac
addresses and then we come through here
and then we run through each one if we
find it we print the name if we don't we
do not found so that gives you an idea
how to use the operating system how to
use ARP or how to use the ARP table how
to arrest API call so on and so forth uh
then we get to the final ones again
pretty simple at this point um what is
this so we have a
list a list we're going to Ping through
oops not that
one so ah anyways uh so this is the
first one we're going to do it's going
to lab ping uh so um we're just going to
Ping through a list to see if they're
found so if I run
this basically it is simply going to
send a command to to the operating
system and ping these different values
so
192.168.1.1 and here's the Ping response
CNN.com and here's a ping response
fox.com and the response so forth so all
this is import OS command equals so
again if you're using um oh if you're
using Ubuntu or lenux you have to do
this ping space hyphen C for count space
one and then space so that's the whole
command um host list this is a list of
hosts 192168101 CNN.com fox.com for host
in host list try os. openen command
host. read so this will turn the object
response back to a
stream uh except if for some reason
doesn't work say there's a problem and
then simply print out print post and
whatever the response is that happens
once and again just kind of gives you an
idea of how this works it o kind of
shows you how ugly it can be it's like
well okay I mean you get these responses
by CNN.com I mean like that's the whole
response that's kind of ugly so one of
the things we can do is we go over
here over here let me get rid of this
for a
second and what this is going to do is
it's going to continuously
ping um basically uh these different
sites and it's simply going to give us
our Rel y here it's not going to give us
all that additional information so this
is going to repeat about every 10
seconds you're going to notice
192.168.1.1 64 bytes and basically this
time equals this is the latency latency
is how long it takes for the uh for the
packets to go to the server and back
again we can see 10 milliseconds here
CNN.com we can see a latency of 36
milliseconds and fox.com we can see a
latency of 28 or 38 milliseconds if I go
here as I had before one of the things
you can do is again if a server isn't up
and running you'll notice it takes some
time gota wait for the timeout
here see 192 168 199 no response so we
can see that there's a problem here and
again this will still Loop every 10
seconds um if we go and we take a look
at this all pretty simple stuff so
import Os from time import sleep so
basically all that import sleep is for
is we're simply going to uh delay the
loop for 10 seconds every time it goes
through so it's not just right if if you
Loop too fast sometimes that's a problem
so we're going to delay for 10 seconds
okay command equals ping space hyphen c
space one space host list equals our
host list and again I did put in a uh an
IP address that's going to fail so you
see what failure looks like we're then
going to do ARG
equals uh pipe GP time equals so what
grep is grep basically will only show
you any lines in a command line response
that have this in it right so
uh okay so let's see here clear uh
ping
C1 CNN.com right okay so we take a look
at this and this is the full response
that's coming back now again one of the
things you need to be thinking about as
a coder is how to clean this mess up so
it's easier to deal with and again it's
many times it's a multi-layer thing and
so I'm looking at this and again what do
I care about uh ping CNN well I know
that I've already did that I don't need
to see that ping statistics I mean if
I'm getting a response back I don't
really need to see this what information
here is actually interesting to me and
so I look at it I go you know what's
actually interesting to me is the
latency how long does it take the
response to come back so what I can do
is I can say okay what in these lines is
specific to these lines right so there's
like the equal sign so let's see if I do
that so if I do this
pipe GP equal so I only want lines to
come back to have an
equalent um so we see um I get the
latency thing but then I also get this
down here this is actually also latency
thing but that gets a little bit wordy
so I look back at this more and it's
like well time
equals time equals is something that's
static like this number will change this
will never
change and so what if I do that what if
I
do so
grip time
equals look at that so I send the Ping
command and the only line of response
that I get back is the one that actually
has that latency information in it and
so again this is this is where we talk
about the full stack this is where we
talk about the the tech stack and how
all of these things come together many
times you can make your life a hell of a
lot easier as a coder is if you actually
understand some of these operating
system commands you can clean up the
data at the operating system level
before you got to deal with it with
python and Rex and all that kind of mess
um and so that's basically what we're
doing here with the the the GP we're
simply saying only return any line that
has time equal in it um so while true
we're going to do os. system clear so
we're going to clear the screen keep the
screen all nice and clean uh for host
and host list right try response equals
P open command so the
command right ping hyphen C1 host what
we're doing and the arguments and the
arguments I read so whatever response
comes back that'll be the value response
except so basically um if for some
reason this doesn't work the response is
going to equal
problem uh if response uh equals equals
equals nothing so one of the interesting
things here um is sometimes you get a
response but the response value is
nothing that's not useful so anyway
we're going to say if the response
equals nothing response equals no
response and then we're going to print
the host so we're going to print
whatever that domain name is SL next
line whatever the response is and then
we're going to sleep for 10 seconds uh
so that's where we go through we do this
yeah we do 192 we get that we do CNN we
get that and then we're going to get
kind of do 192 that 192
16899 right so we get no response so we
actually got a response back that was
blank so that's not actually useful so
we're going to just change it to no
response and that's what the answer is
going to be and then it Loops every 10
seconds holy
crap that was a long
class
so questions does anybody have questions
before I go out and drink some beer
tonight at asille digital Nomads digal
Nomads is having a party it's time for
me to have some beer um any any
questions that that's that is the class
for today these are the labs you should
be able to work through it I'm not going
to be able to stay for half an hour just
CU this class has gone way too damn long
to begin with um any
questions I am questioning how many of
you are
awake question
Matthew unmute yep
okay so this is a new question like need
to know everything going back to the
switch yes
switch so you still got multiple
computers on there and how does it get
away from the Hub issue of
People handling multiple communication
happening at the same time is there like
a big buffer or is there no no so basic
process so so there's the bridge right
so so remember we're talking about with
this whole thing the bridges separated
based off of Mac
addresses so each Port is essentially
its own
Bridge so when the communication
happens so so with a hub so the Hub is
dumb like the Hub literally if you open
it up is essentially just wires solded
together there's no intelligence there
so the Hub any communication goes in it
literally goes out every single port so
with the switch what happens is you do
have intelligence and again that's why
you have to buy a decent quality switch
because the computing power in there
actually matters and so the switch has
that Mac address
table and so when you try to communicate
if it doesn't know where a MAC address
is it will blast out on every port to
try to find where the MAC address is
once it's found what port that Mac
address is at any communication then for
that Mac address will automatically
internal to the switch just be routed to
that particular Mac address so when this
this computer so the if the switch knows
these two Mac addresses when there when
these computers are communicating with
each other essentially internal to it
becomes just one Communication channel
and then none of the other ports are
messed
with does that make sense a little bit
yeah so are there multiple processors
or depends on the the particular switch
that you buy and again that that's why
you talk about like the difference
between a $10,000 Cisco switch and a $30
linki switch um is yeah that's where
it's like there's there's in in the
switches there something called a back
plane and the back plane is essentially
the intelligence or the electronics that
powers all of this and so that's why
like if you if you have a a a home
network you go out to Best Buy you drop
40 bucks and you buy a switch uh whereas
if you have an Enterprise Network where
communication really matters you drop
$10,000 for Cisco switch it's basically
based off of again
how how reliable do you actually care if
it is you know how many devices is are
going to be connected into this thing
that type of deal got it thank
you uh let's see
Isa Isa what's up
eyes eyes
eyesa hello yep hi yes my my question is
uh when we sign up signed up for this
class are we automatically uh registered
for future classes or do we have to sign
up for the future classes uh you have to
sign up for future classes I mean it's
all on Meetup um so uh so yeah I I
basically schedule the classes as I as I
come up with them so we uh there's a
Tuesday class that's going to actually
be on building stuff um so now now that
I've taught again any students that
followed along um we've taught you how
to do python obviously the bottle web
app framework we taught HTML CSS and SQL
so like on Tuesday what we're going to
do is we're actually going to try to
build some um some useful uh basically
we like net worth monitoring web apps so
you can start to see where all these
things kind of come together um but yeah
basic basically again as far as the RSVP
system is concern there's no payment or
anything but like every single class has
its own link for me so every every class
has its own Zoom meeting so that's
basically how you get you find the zoom
meeting URLs and that type of deal
yep okay thank
you oh can we do Vin the virtual classes
uh yeah so venv is virtual
environments yeah we're going to
get again one of the things you have to
be thinking about and this is where I
get into trouble with a lot of like real
technology professionals like the worst
real technology professionals are the
ones that have done it for like five
years right because noobs noobs are
really easy to write off because they're
noobs and again people have been doing
it for a couple of decades they're too
tired they just want to go home you get
like the the the guy the people have
been doing for five years so they know
what they're talking about yeah they
just haven't really dealt with reality a
lot and so the problem that you run into
as a technology
professional is that you need to solve
for the problem that your users have so
you can come up with this really
Hightech solution but if your users
can't keep up you're screwed like I had
a client of mine they were a printing
company anyways they they literally it
was out of their office or out of their
home office it was a husband and wife
team and they did like custom printing
they had hired they had hired a security
professional to come in and do some
cyber security Wizardry so they had like
three computers a couple of network
printers and literally something wasn't
working right so they called me and they
literally handed me a damn three ring
binder of the security configurations
that have been done on their Network now
to be clear they were not printing for
the NSA or Banks or anything like that
they were printing for 4 AG clubs right
and so the thing was like their
security again it wasn't wrong wasn't
wrong it was
just right anyway so they ended up
paying me a lot of money to to to to me
to to prune their security policies so
anyways uh where that comes with the V
andv so it's a virtual environments V NV
which are great I actually have a class
on YouTube if you got my my YouTube
channel I have a class on v v vims and
basically what this does is it allows
you to
compartmentalize your python code so
when we install modules and all that
kind of stuff like requests here like
you may be working on multiple different
projects you may want to have certain
projects have access to certain modules
or more importantly especially in this
open source GitHub type
World different projects may require
different versions of the same
module and so what you can do is you can
create Vim so instead of using pip to
install the module just simply onto your
computer basically with virtual
environments you're able to
Silo your modules essentially Silo your
environments right so this VMV has
requests and open Ai and bottle and this
VV you know has open AI version two
instead and bottle and this VMV has
something else the good part about this
is not only does it compartmentalize
make it a hell of a lot easier as a
coder to make sure what's going on but
it's also um requirements you can
actually run a script off of this that
will create a text file that will
actually say what um modules and
versions are installed within this
virtual environment and you can send you
can have that especially like in GitHub
as simply a text file so that somebody
can run that text file to basically
recreate the virtual environment so that
they when they run the script they have
all the correct modules to function and
everything works
properly the issue is is notice how I'm
scribbling on the Whiteboard about this
this is great this is fine I have
nothing against virtual environments no
snark at all but it is another level of
complication so what I'm trying to
explain to people try statements and if
else statements and data
types adding this into the mess isn't
something that I want to get to you
folks right at this particular time um
so we are going to get into this again
when we start deploying so if you want
to deploy a bottle web app or a Django
web app or whatever else you really do
need to actually do it in a virtual
environment scenario so we are going to
have a class and I think the class is
going to be on creating the python
coding environment so we're going to
talk about the environment variables
again that's one thing that I have to to
go through and actually write out how to
do environment variables we'll go
through virtual environments we may go
through additional extensions or
whatever for python so basic again
that's the other thing for me too is I
have to get enough together to do a
class like just doing VV I I can explain
it to in five minutes 10 minutes uh it's
getting enough together to have a class
so that I can teach you folks in a way
that makes half a bit of sense um so
anyways that that that is the other
thing too like with bias just for
anybody who's still watching again
whenever you have an instructor you
really have to think about what their
bias is what their view to teaching you
is my view to teaching you is to get you
to do something vaguely useful as
quickly as possible once you see that
you can create something that does
something interesting you will be
motivated to continue on I can tell you
the first programming language that I
tried to learn was C++ I got the Sam's
C++ in 24 hours so I had my army
training I had my mcse and I was going
to sit down and become a coder after I
spent 24 hour whatever a week or two
learning C++ again my joke is I knew how
to create the cat class there I go a
class and I knew how to create a cat
class other than that I didn't know what
the to do with C++ and so I never
use C++ again right and I think that's
one of the big problems we get to in the
coding world again the IT world is we
explain active directory we explain
security policies we explain