When I hear/read about internet address, it is always IPv4 address or its successor IPv6 address? But as far as I know, these are not built into the internet itself. Instead, these addresses are defined and used by the IP protocol. In that case, why isn't there an alternative protocol?
If it is there, does that use a different internet address? I never heard any addresses like this!! My device's IP address is decided by my ISP. Instead if I'm using some other protocol, address for that also will be provided by my ISP?
Also, does MAC address have alternatives? For this, I think the answer is 'no'. Because, MAC address is built into the device while manufacturing. So, I want to use a different protocol, which uses a different kind of address, then entire device has to be changed! Is this correct? If not, what are the other hardware addresses like MAC?
Is it possible to have a communication network without IP? Sure.
But the internet, by definition, is a network of networks that use TCP/IP to communicate. IP is the gule that makes it possible to the point that you could argue that the IPv4 internet is a separate network than the IPv6 one.
Related
I am trying to understand how exactly routing works:
if 2 computers are on the same network
if they are on different networks.
More specifically I am trying to understand this: Routing
I am also trying to understand the difference between
IP Address,
Net Address,
Mac Address.
From what I understand:
1) IP Address: is used when computers communicate on the internet only.
2) Net Address: is a local version of the IP address and each device on the network has a unique net address. It's used when devices on the same network want to communicate with each other.
3) Mac Address: is a globally unique address and no other computer in the world has the same Mac address. In reality this is not true because it can be changed. It's used when ???
When a computer wants to communicate with another on the same network, they use net address, right? If the computers are on different networks what exactly happens?
Question: Can someone please fix my mistakes if any and explain what I am missing?
Thank you very much.
There are many network types, but since the most used ones are Ethernet and IP networks (and you seem to be asking about them), I will answer shortly based on them.
IP addresses are always used. They may not be used for deciding who gets the packets directly, but they are the basis even in local networks, since it is an IP network. There can also be other network types that have their own mechanisms, but they are not that common.
In local Ethernet the machines ask via ARP protocol "who has this IP address?" and get a reply with a MAC address. After that they send and receive packets based on that MAC address. The packets still have the IP address information, otherwise the receiving machine wouldn't know what is the destination. Do note that the receiving machine might be a firewall or other middleware device, not the actual computer that has the address. Also a single machine and network card may have several IP addresses set up for it.
In IP networks the IP address is used for routing. All routing devices have a routing table that will tell where the packets should go. If it's a simple device, it usually has a local network and everything else goes via a default gw, which will know better what to do with the packets.
A home router will just push them to the operator, there another router will know what addresses go to their networks, others are pushed forward via another connection, until a bigger place is reached where there are inter-operator connections and they choose again the correct route. And then it goes to smaller and smaller pipes the other way around.
I got a question
Can we communicate with only using mac address with a computer which is in my network?
So i said yes.
Because when we communicating using arp protocol we only use mac address.
I want to know whether my answer and justification is right or not?
You are correct. ARP does communicate on the same subnet using MAC addresses. Your answer could be improved to include that the computers have to be on the same subnet. It could be further improved to reveal that a router can be attacked so that it turns into a switch and opens its subnets on wired and wireless to reside on the same subnet as far as ARP is concerned. The attacks are ARP flooding and ARP poisoning.
I know the RARP protocol is used for mapping physical address to logical address and its some practical applications. Now I have studied RARP(reverse ARP) protocol but cannot find its practical applications. Can anyone give some scenerios and practical applications of RARP protocol.
RARP is now an obsolete protocol that was used to allow a host to determine it's IP address based on the host's MAC address. The protocol was rendered obsolete by more modern techniques and protocols such as BOOTP and DHCP (Dynamic Host Configuration Protocol).
It's unfortunate that RARP is obsolete, because it's extremely handy in determining an unknown IP address of a device. If someone sets a static IP on a device, then years later it is forgotten, moved to a different network, found sitting on a shelf and someone wants to use it, you could RARP the MAC address printed on the device to retrieve its IP.
how can a host find the mac address of system in another subnet.
It, in general, can't. At least not without the host cooperating by e.g. sending it explicitly (as payload) using e.g. TCP or UDP. MAC addresses are only of interest to hosts on the same network, in general.
Is there an elegant way to make a program detect a new computer that is connected to the network?
I would like my program to "auto-sense" a new computer being connected on the network (they're on the same network). Like a USB device being connected to the computer.
What I'm doing now is to save a list of all computers in the network from time to time. Another approach is to PING all available IPs on the subnet.
Are there any other elegant approaches?
Thanks!
Listening for ARP requests is the canonical way to do this. Independent of DHCP or not, any connected computer that wishes to communicate with the outside world will have to make an ARP request for the address of the default router. This request will go out as a broadcast, and contain the source interface's MAC and IP adresses.
If the other computer uses DHCP, it will make an ARP request for it's own address as part of duplicate address detection, which is also a broadcast you can snoop on.
(This works more or less the same way for IPv6, except you need to look for neighbor discovery or router soliciation packets instead.)
Like the answer alluded to, if you have a switch to which you can telnet or use SNMP on, you can extract the MAC table. That will give you a list of MAC adresses on each port in the switch. If you want the IP addresses however, you still need to listen for ARP:s.
On the other hand, if you have access to the default gateway on the network, you can also look at the ARP table there. That will give you MAC and IP addresses for anyone that has recently (for different values of recently...) communicated with it.
If you have a managed switch of some kind, you could probably connect to that, that would be a fairly elegant method.
If you're on a domain, you can can get a list of all the machines joined to the domain from the domain controller.
Failing that, all I can think of is either a challenge/response thing (e.g. pinging them) or by detecting traffic sent from them (see this question maybe as a starting point?), neither of which strike me as an elegant approach.