In this lesson,
we're going to talk about TCP/IP fundamentals,
which are the very foundations of networking.
Now, one of the major components of the operating system
is networking because we have to be able to have networking,
to communicate with the outside world.
Networking is crucial for almost all modern systems,
including those that run Linux.
So in this lesson,
we're going to review some of the fundamental concepts
that are involved in networking,
and then you're going to configure networking
in your Linux systems.
This will ensure your systems, especially your servers
will be able to communicate with other computers,
both locally and around the world.
Before you start developing Linux specific
networking skills, though,
you need to review some fundamental concepts
that comprise modern TCP/IP networks.
Then you'll be better equipped to manage networking
in your Linux systems.
Now Linux offers all the necessary networking tools
and features for integration
into all types of network structures.
Linux and other Unix operating systems
use the TCP/IP protocol.
It is not a single network protocol though,
but instead it's a family of network protocols
that offer various different services.
Many families or suites of protocols
have existed over the years.
But these days, the only protocol suite
that most people use is TCP/IP.
Now another thing we need to talk about is the OSI model.
The OSI model, or the Open Systems Interconnection model
is used to standardize how networking is functioning
inside of all of the different computer networking models
and all the different protocols.
Now, the OSI model is an abstraction that shows us
how these things would work in an ideal
or theoretical world.
The OSI model has seven layers to it.
And each of those layers represents
an area of responsibility that has to be satisfied
for the networking to be able to process and do its job.
As an IT professional,
you need to understand how these layers work.
If we start at the top or layer seven,
we have the application layer and the application layer
supports applications and end-users.
When you go to layer six, this is the presentation layer.
This is where the formatting of data is going to occur,
and cryptography is going to be handled.
At layer five, we're going to have the session layer.
This is used to establish, maintain,
and tear down a connection between two different devices.
Layer four is our transport layer.
And this enables the reliable transmission of information
using TCP or UDP.
When we get down to layer three, we're at the network layer.
Network layers are going to use logical addressing
like IP addresses to tell data where to go
on a given network.
When we get down to layer two, we're at the data link layer.
The data link layer is where we're going to be using
physical addressing things like MAC addresses,
to be able to send data around our local area network
instead of across the internet.
And finally layer one is our physical layer.
This is actually the cables, the radio frequencies,
and other things that enable physical network connectivity
to occur between two different systems.
Now, when you look at the TCP/IP protocol suite,
it satisfies the requirements of the OSI model,
but it does it in only four layers.
This is also known as the TCP/IP model, or the DOD model.
This suite is used to govern the network communications
on most internal network and protocol suites
on the internet too.
Now, having an understanding of the TCP/IP suite can really
aid in troubleshooting and network configuration,
just like knowing the OSI model can.
If you want to learn more about both of these,
I do recommend you take a good course in Network Plus.
Now, when we talk about networking,
you'll often hear the term node.
Now, a node is a term that refers to devices
with an identity on the network.
This can be a computer, it can be a server,
it can be a tablet or a smartphone,
really anything that's connected to the network
can be a node.
The identity of that node will be represented
by a physical address, or a MAC address,
or a logical address, like an IP address
or an IP Version 6 address,
or you can use any combination of those three.
Now, when you're using a MAC address,
this is the most fundamental network identity
that's out there and it's considered a physical address
and it operates at the data link layer
or layer two of the OSI model.
If you're using an IP address,
this is considered a logical address.
And an IP address is going to be used at layer three
or the network layer of the OSI model.
When you're using an IP address, most commonly,
you're going to see an IPv4 address or Version 4 address.
Now these Version 4 address are written
in dotted decimal notation,
which is written in base 10 numbers.
These are going to have a range from zero to 255
in each of four positions.
And each one is going to be separated by a dot.
So something like one 192.168.2.1
would be an IP Version 4 address.
Now, a computer though, doesn't use addresses in decimal.
Instead, they like to look at things in binary,
which means everything has to be written as a zero or a one.
So it would take that address and convert it into binary
for use on the network.
Now, on the other hand, we, as humans,
don't really like to have to memorize numbers.
So instead we like to look at things
in human-readable format, something like a host name.
So that IP address can also be represented
by the host name of the node.
For example, if you go to my web server,
it's diontraining.com,
instead of you having to type in the exact IP address.
Now the host name is this human-readable name
that helps people better understand what device
they're actually working with.
On the internet we use domain names for this purpose,
but on your local intranet,
you can use a host name instead like server,
or database server or payroll server or something like that.
This identity will often be configured
during the installation of the operating system.
And often we call this the computer name or the host name.
Now there's also several essential network devices out there
and different components that you need to understand
so you can figure out how all these things work.
These can be part of your troubleshooting,
or it can also be used during network installation.
Now Linux systems need to be configured properly
to interact with different network devices and components
to able to perform their functions on the network.
The first one we're going to talk about is a switch.
Now, a switch is a device that acts as a concentrator
and it centralizes all network connections
for a given segment to a single device, known as a switch.
This switch can be used to manage traffic
for performance and security concerns as well.
As a general rule switches work at layer two
of the OSI model,
and they do their switching using MAC addresses.
If we want to operate at layer three,
we're going to use a router.
Now, a router is a device that acts as a central point
for communications between different network segments
and they connect two different networks together.
Now, administrators can configure the router
to permit or deny certain kinds of traffic
using access control lists,
as well as the ability to pass traffic
from one network segment to another,
such as going from your internal network to the internet,
which is an external network.
These routers are going to operate at layer three
of the OSI model, like I said,
and they use IP addresses either Version 4
or Version 6 by default.
Now media is another term you have to be aware of.
Media just refers to the actual path
that we're going to send the electrical signals over
to go from one device or component to another.
Now, most typically we're going to be using
network cables for this purpose.
Specifically, twisted pair ethernet cables.
Now these twisted pair cables can come in,
either shielded or STP or unshielded UTP Versions.
Just like you learned about back in A Plus and Network Plus.
When dealing with these type of cables,
it is relatively inexpensive and easy to work with.
Now, another type of cable you might use is fiber cables.
They're harder to work with.
They're a little bit more expensive,
but they do give you a lot better performance.
Additionally, when we're talking about layer one devices
like these two types of cables,
we also need to consider radiofrequency.
If you're using wireless networks, you're going to be using
radiofrequency waves that are basically invisible cables
to connect your two devices.
All right, now that we've covered some of the main devices
and components inside of our networks,
let's talk about the data as it moves through the network
at different layers.
When we talk about data, it's called different things,
depending on what layer we're operating at
inside the TCP/IP network, or the OSI model.
If we're going to be operating at the network layer
of the OSI model or layer three,
we're going to refer to this data as a packet.
Now, when we get down to layer two or the data link layer,
we're going to refer to it as a frame.
When we get down to layer one or the physical layer,
we're going to call it a bit, which is a one or zero.
It's just the amount of data that we're grouping together
at these different layers.
That's going to give it a different name,
whether it's a bit, a frame, or a packet.
Now, when we're dealing with network services,
we have a lot of different network services on the network,
but two are very, very important to us.
And these are DNS and DHCP.
Now you're going to have to understand the role
of these two different services
if you want to properly configure your Linux systems
to use the network.
First, we have DNS, and DNS stands for
the Domain Name System.
This is a service that provides name resolution.
It's a way of creating easy to remember host names
with a difficult to remember IP address.
Again, remember I said, if you go to my website,
it's diontraining.com.
That is the domain name.
And DNS allows you to type in diontraining.com
and will automatically convert it to the IP address
that's really associated with that server.
DNS is going to be implemented as a database that's hosted
on one or more servers as part of this DNS system.
This database can contain the names and the IP addresses
for all the nodes in your own network,
or it can be part of the larger internet DNS infrastructure.
So when I'm talking about my website,
that's part of the larger internet DNS structure,
but I also have a local DNS server
for the servers internal to my network.
Next, we need to talk about DHCP.
You see, all of the different computers and tablets,
and mobile devices, and servers, need to be configured
with some basic information in order for them
to make a connection on the network.
We can do this in one of two ways.
We can do it statically or dynamically.
A static configuration is when somebody goes
and manually configures this information on the servers
or network devices.
But dynamic configuration is a lot easier to use,
especially when we're dealing
with a lot of end-user workstations.
With a dynamic configuration we're going to use DHCP
or a Dynamic Host Configuration Protocol.
DHCP is a service that provides dynamic configuration
of your endpoint devices by providing them
with their IP address, their subnet mask, their gateway,
and their DNS server to use.
Now, IP addresses are going to use an addressing system
for managing your different network identities.
When we deal with IPv4,
we're dealing with a very old protocol.
It was actually defined all the way back in 1981,
and the addresses were 32-bits in length.
And this gives us about 4.2 billion addresses out there.
Now IPv4 are going to be divided into at least two portions.
We have a network identifier portion
and a host identifier portion.
The network identifier is going to define the network segment
that that host belongs to.
And the host identifier uniquely identifies the host
within that segment.
Now these approximately 4.2 billion IPv4 addresses
are going to be divided into five different classes
and they're labeled A, B, C, D, and E.
These classes provide a framework for possible segmentation
of our different networks.
And each class provides a specified number of networks,
as well as the number of hosts available on each network.
For the first three classes, A, B, and C,
the division is going to occur based on the network ID
and the host ID based on one of the dots
in this decimal dotted notation.
Network professionals can easily recognize which class it is
by the value of the first octet.
And then they'll know the default subnet mask
for each of those classes.
For example, a class A address is going to start out
with a zero, dot something, dot something, dot something,
all the way up to 127,
dot something, dot something, dot something.
So as long as you have something between zero and 127
as your first octet, you know, it's a class A address.
If you're dealing with class B,
it's first octet is going to start with a 128.
So all of its addresses are going to be 128,
dot something, dot something, dot something,
all the way up to 191,
dot something, dot something, dot something.
And so if you have something with the first octet
of 128 to 191, you know, this is a class B address.
With class C, we're going to start out with 192.0.0.0,
and go all the way up
to 223.255.255.255.
And this tells us that anything that starts out with a 192,
going up to a 223 is going to be a class C address.
When we get to a class D address,
we're going to have a starting address of 224.0.0.0,
and an ending address
of 239.255.255.255.
So again, if we start out with 224
and we go all the way up to 239,
that is going to be in our first octet and telling us
that it is a class D address.
Finally, we have a class E address,
and this is going to have a starting address of 240.0.0.0,
and an ending address
of 255.255.255.255.
So if you have anything between 240 and 255
in that first octet,
you know, you're dealing with a class E address.
Now, in addition to knowing these five IP address classes,
there's several other IP addresses or address ranges
that are pretty important to us in networking.
Now because of the depletion of IPv4 addresses over time,
and there's only 4.2 billion or so of these,
there are three IP address ranges that we reserve
for internal use inside your network.
These are known as private IPs.
Now this class A reserved range for a private IP address
is anything that starts with a 10.
So if you have 10.0.0.0,
all the way up through 10.255.255.255,
that is considered the private class A range.
And that gives us 16.7 million addresses
that we can choose from as private addresses.
If we're going to do this in class B,
the class B reserved
or private range is 172.16.0.0
all the way up to 172.31.255.255
So if the first two octets start with 172.16,
up through 172.31, that is a private class B address.
And finally we have the class C range.
The class C reserved or private address range
is 192.168.0.0
all the way up to 192.168.255.255.
So if you have an address that starts with 192.168,
dot something, dot something,
that is going to be a class C private address.
Now there's a couple of other addresses
that we need to talk about as well, that are special.
One of these is the loopback address.
Now the loopback address is used for diagnostic purposes,
and it gives the system the ability to network with itself.
This is known as 127.0.0.1 by default.
Another one we have is the link-local range,
which is used for zero configuration LANs,
or when the DHCP lease generation fails to work,
and this is also known as APIPA
or the Automatic Private IP Addressing.
This link-local or APIPA range is any address
that starts with 169.254, dot something dot something.
Now IPv4 is pretty useful and it's still used
pretty heavily these days,
even though it was created all the way back in 1981.
But over time, we started running into some limitations
specifically the fact that we only have 4.2 billion
or so IP addresses.
So a newer standard was released known as IP Version 6.
IP Version 6 fixed a lot of the weaknesses of IPv4,
and it has a much larger address space
as well as built-in encryption
and a more efficient routing mechanism.
We're not going to dive too deep into IPv6 right now,
but again, this will going to be something that's a review
from your A Plus or Network Plus studies.
Remember that IPv6, instead of using a 32-bit number
is going to use 128-bit number,
giving us a lot more addresses out there.
In fact, we have 340 undecillion IP addresses in IPv6
versus the 4.2 or 4.3 billion that we have in IPv4.
Another thing we need to discuss is port numbers.
You're probably familiar with this,
again from your A Plus, Network Plus,
and Security Plus studies,
but network port numbers are numerical values
that are assigned to various application layer protocols
like FTP is port 21.
SSH is port 22 and things like that.
Now your network devices are going to use these port numbers
to understand what application is going to handle
the communication for that particular device
over the network.
Humans work with application layer protocols by name
all the time.
Things like HTTP or the Hypertext Transfer Protocol,
for example, but a computer needs to know the port number.
So HTTP is port 80.
If you're going to use something like
Post Office Protocol version 3,
which you use for email that's port 110.
If you're going to use Hypertext Transfer Protocol Secure
that's port 443 and things like that.
Again, going back to your A Plus, Network Plus,
and Security Plus studies,
you should be familiar with what different ports are
for particular applications
that are very popular in the world.
Things like POP3, IMAP, HTTP,
HTTPS, SSH, FTP,
Telnet and more.
Network administrators are also going to divide up
your network into segments.
And this allows us to better manage our network traffic
and reduce some of the congestion.
Our goal here is to manage traffic more efficiently
and more effectively,
and this results in better network performance,
and allows us to isolate traffic
that we want out of our networks
based on the purposes of security.
The logical divisions of our network
are going to be referred to as subnets
and they're referred to by a network ID.
This network ID is going to be part of the IP address
for each node that we're going to be using
and all those nodes in that subnet
will have the same network ID in their IP address.
This means the same beginning part is going to be used
by all the devices on that particular network.
Now, each node is going to have its own unique host ID
within that subnet too, to identify itself.
So, for example, let's say I have a computer network
with 10 machines on it,
and I want to have them using a private IP address range
in the class C network.
I might assign the network as 192.168.1.0
as my network ID.
Then I'm going to have all of my IP addresses for my individual
machines being part of that network.
So the router might be 192.168.1.1.
The first computer might be 192.168.1.2.
The second computer would be 192.168.1.3 and so on.
Now notice they're all going to start
with the same first three octets,
because I'm dealing with the standard class C network,
and that's why I have 192.168.1 dot something.
And all of those are part of that address of 192.168.1.0
which is my network ID.
Again, if you're not getting the concept of subnetting,
I definitely recommend going back
and looking at your Network Plus studies,
because that is something that is covered in that course
in a lot more depth.