What Are Static IPs, Ports, DHCP, and MAC Addresses?

AI Thread Summary
A static IP is a fixed IP address assigned to a device, contrasting with a dynamic IP that changes periodically. Static IPs are beneficial for hosting services like web servers, as they maintain a consistent address for domain name resolution. DHCP (Dynamic Host Configuration Protocol) automatically assigns dynamic IPs to devices on a network, preventing address conflicts. MAC (Media Access Control) addresses are unique identifiers for network interfaces, crucial for routing packets within a local area network. Ports are numerical identifiers used to distinguish different services on a server, such as HTTP on port 80 or FTP on port 21. Servers listen on these ports to handle requests from clients, allowing multiple services to operate on the same machine. Understanding these concepts is essential for network management and server configuration.
VietDao29
Homework Helper
Messages
1,424
Reaction score
3
I know it's embarrassing to ask this. But I don't know anything about the stuff about Internet, server,...
What's a static IP? How can I create a static IP?
What's a port? What's a port used for? How can I establish a port?
What's DHCP? What does it do? And what's MAC?
I tried to search for this, but I didn't quite understand it. The words they used are soooo confusing... :cry: Can you guys please help me...
Any help will be appreciated,
Thanks,
 
Computer science news on Phys.org
Static IP
DHCP
MAC - the definition changes depending on the context its used in.
Are you sure you searched properly:-p
 
1) A static IP is an IP address that stays fixed while a dynamic IP is an IP address that changes every so often.

A static IP is assigned differently depending on what operating system you using.

2) Ports are used distinguish between different services. Example: Port 80 - HTTP, Port 22 - SSH, Port 631 - IPP

You can open ports by using a library like sockets.h in c/c++

3) DHCP is used to assign computers a dynamic IP

MAC is a unique number given to an ethernet card. It is an easy way to identify you computer from the rest of the network.
 
Ports are the sockets that tells the upper layers how to service the data that is being streamed into the application layer.

port 21 means that the ftp application should service the data
port 23 means that the telnet application should service the data

When packets are being encapsulated, the layers below the transport layer (where ports are situated) don't really care, its when packets are being decapsulated ports are important.. You can also implement a bit of securty on the network using ports.

Mac addresses are Hexidecimal 'numbers' that are used for switching packets to there destination, and are an important part of the IP protocol suit, and are needed to find Network devices on a LAN.

DHCP is the Dynamic Host configuration protocol, so people who don't need to care about the inner workings of IP can have there IP addresses given to them automagically by a DHCP server. The DHCP server would be configured by your Network Admin
 
Last edited:
You'll want a static IP instead of a dynamic IP if you're running services on your computer that you'd like other people to access, such as a web server, ftp server, mail server...etc
The reason is not that you can't be reached if you have a dynamic IP, the reason is that your Internet Service Provider will change your IP every so often (i've had the same dynamic ip for a while now, +3 months i think, it has only changed once). So if you have a domain name www.mydomain.com[/url] which is associated with your IP, in the future if your ISP changes your dynamic IP, then [url]www.mydomain.com[/URL] will be associated with an incorrect IP so it won't direct visitors to your site. Of course you can easily realize this and change it, giving time for DNS to update it'll be fine within a day.
Unless you are a business or have some really big plans you probably won't need a static IP. Notice that, depending on your ISP, you have to pay more to get a static IP, they usually have a "Business Plan" or something which includes a static IP, but I've never checked to see how much more i'd have to pay (you'd also get more bandwidth and a better upstream with a business plan).
Notice that your ISP assigns you a dynamic IP using DHCP (this is all related). That's what DHCP does, it dynamically assigns IP addresses (making sure that no two computers have the same one). Usually you have either a traditional server (Win Server, Unix Server, ..) or just a simple router taking care of the DHCP. If you have a router at home, whenever you connect the computer to the router, the router, acting as DHCP server, dynamically assigns your computer some IP.
The alternative to DHCP, is for you to go to every computer in your network and manually assign an IP (static IP), making sure that no two IPs are the same. So DHCP is a lot better.

On to servers. What a server is is a piece of software running on some machine (any machine will do, but fast ones are better) that is listening in on a port. Ports aren't physical, they don't actually exist, a port is just a parameter varying from 0 to 65535 (give or take). A web server runs on port 80 for instance. So for example [PLAIN]www.yahoo.com[/url] has a web server listening on port 80 (they really have more than one server, but to simplify). When you point your browser to [url]www.yahoo.com[/URL], your browser does the following:
. gets the IP address that [url]www.yahoo.com[/url] is pointing to (with a DNS query)
. connects to that IP on port 80.
. talks to the server using the HTTP protocol.
. the server replies with an html document which is the webpage.
. the browser parses the html and displays the page

This is an over simplification, but it gives you the idea, of how ports are used. Mainly, the advantage is that i can have many servers running on a machine (Mail, Web, FTP) which listen on different ports, so you won't, for instance, connect [url]www.yahoo.com[/url] and instead of getting the web server, you get the mail server.

If you're a programmer, you use use a socket to create a connection to a port on some computer, in Java it's kind of simple, like new Socket(64.118.189.241, 80). That's my server's ip address, [PLAIN]http://www.bloo.us .
 
Last edited by a moderator:
Thanks guys very much. I understand it now... :smile:
 
This week, I saw a documentary done by the French called Les sacrifiés de l'IA, which was presented by a Canadian show Enquête. If you understand French I recommend it. Very eye-opening. I found a similar documentary in English called The Human Cost of AI: Data workers in the Global South. There is also an interview with Milagros Miceli (appearing in both documentaries) on Youtube: I also found a powerpoint presentation by the economist Uma Rani (appearing in the French documentary), AI...
Back
Top