IP Address, that's the IP address of your shield, optional.
DNS, so that's the IP Address of the domain name server that you wanna
connect to by default and you don't have to give that.
A gateway is the address of a router,
which knows how to route packets to other networks.
So if you're going outside of our local network, which we won't in this class.
But if you are, then you might want to specify a default gateway.
A default router to go to when it wants to send packets to an outside network,
it can go ask this gateway router for the path to say, how do I get this there?
Now if you don't give a gateway, it will find a gateway.
But sometimes a particular service will have it's own gateway to speed thing sup,
but you don't have to do that.
Also the subnet mask.
Subnet mask tells us which other IP addresses are in the local subnet.
So this is sort of a flexible idea, but
a subnet you can think of as your local network.
And generally, what happens with the IP addresses.
The prefix, so it's a 4-byte number, 4 numbers separated by decimals.
And the higher bytes, the most significant bytes are often held constant for
all the machines in a local subnet.
So in a local subnet maybe it's 128, 198,
200 are the first 3 numbers and then the last number is a 1 from my machine,
a 2 for the next machine, a 3 for the next machine and so on, but they share.
In that case, the local subnet shares the high 3 bytes.
So the subnet mask tells you which bits,
specifically are shared by the local subnet.
You don't have to specify this.
If you don't, it'll default to 255.255.255.0.
So what that means is remember 255 in binary is all 1s.
So all 1s, all 1s, all 1s and then all 0s.
So that's saying that the local subnet is just the last byte.
So, all the nodes in a local subnet share the same high 3 bytes.
That's what it says and that'll be the default if you don't set it, but
you don't have to.
Dynamic Host Connection Protocol.
So this is pretty important or DHCP.
So in order to communicate on the internet, you need an IP address.
Every node on the internet needs an IP address.
Now note that in our Ethernet type again, we did not have to specify and IP address.
So how is it gonna communicate on the Internet without an IP address?
Well, it has to get one.
It can get one dynamically.
So DHCP, Dynamic Host Connection Protocol is a protocol that a allows a node,
a new node on the network to request a new IP address.
Now this is generally enabled on routers by default.
So right here, right now my laptop is sitting over there and I open it up.
And when I opened it up, it connected to the local network at school and
it uses DHCP and the local network is setup for DHCP, that's turned on.
And my machine basically in order to communicate, it's first thing it does is
it asks through using this DHCP protocol, it asks for an IP address.
So, it gets it's IP address dynamically from the network and
then the network finds some available IP address and tells my machine.
So here's your IP address and
that's what we're assuming is being used that's very common.
So let's just assume that's whats being used and we don't have to specify
an IP address, we can just assume DHCP is being used to give us an IP address.
Now DHCP is invoked if you call Ethernet.begin ad it has no
IP address argument.
So if you just give it, if you call with a MAC address argument and nothing else,
no IP Address doesn't know anything, then it automatically invokes the DHCP.
Making a request, you don't have to deal with these details, but your machine will.
Your Ethernet shield will make a request to the local network to ask for
an IP address.
Well, after you call up again.
Most routers are configured for DHCP.
Now another way to do this, instead of allowing DHCP,
which gives dynamic IP addresses is that you can also use static IP addresses.
Static IP addresses are fixed IP addresses.
So that means every time you power your machine and connect to the network,
it gets exactly the same IP address.
Now a static IP address, that's more difficult to manage.
Basically, that IP address needs to be known across the world.
It has to be known to any machine that wants to connect to your machine,
it needs to know that static IP address.
It's useful for servers.
It's typical for servers, because like say,
www.uci.edu, there's a web server right there, which I can go to.
And in order for my machine, my laptop to connect to that server to look at
the school's web page, I need to be able to look up its IP address.
So it needs to be static, it needs to sit in the same place and
be in a table somewhere.
So when I request, it's address I can get it.
So servers often have static addresses, but dynamic addresses are very common for
non servers.
Thank You.
[MUSIC]