3

I'm trying to get a head start before my A level and one thing I couldn't quite understand was why private ip addresses are used.

My current understanding is that mac addresses are used amongst local networks to send data. And public ip addresses are outside of LANs. Local ips are used within LAN's only so why are they needed if mac addresses do this aswell?

Another thing I don't understand completely is the private ip classes, A B and C. What is the difference between these?

3

6 Answers 6

2

My current understanding is that mac addresses are used amongst local networks to send data. And public ip addresses are outside of LANs. Local ips are used within LAN's only so why are they needed if mac addresses do this aswell?

Technically, MAC addresses is something that is fairly specific to Ethernet and related technologies. This is an important detail because Ethernet is not the only physical networking protocol in existence, even though on contemporary hardware it certainly is one of the most commonly used ones.

A MAC address addresses the physical Ethernet network adapter. In Ethernet, MAC addresses have no structure that facilitates routing (their structure is based on the hardware manufacturer, not their location within the network). This, as well as the fact that they might not exist on other types of networking hardware, makes them unsuitable for use on an internetwork (a network connecting disparate networks) such as the Internet.

It was recognized early on that it is beneficial if all systems on a network, especially a large network comprised of many disparate systems (such as the Internet), speak a common protocol. This was the motivation for designing the Internet Protocol (IP) and related protocols, such as TCP, UDP and ICMP which all run on top of IP (in a stack where IP runs on top of some physical networking layer, such as Ethernet over twisted-pair, Ethernet over coaxial cable, Token Ring, WiFi, etc.).

An IP address is a logical construction. It is assigned hierichally by various organizations that control large or small portions of the IP address space, facilitating its use for routing purposes (it's easy to tell whether an IP address "belongs here" or "does not belong here", without needing full knowledge of the entire network). Not all network interfaces necessarily have IP addresses (they might be attached to hosts where no IP stack exists, or where one exists but has not yet been initialized, or any of several other possibilities), a single IP address can be used to address multiple hosts, and a single network interface can have multiple IP addresses.

At some point, it was recognized that not all hosts that speak IP need to be able to speak directly to every other host on the Internet. Some hosts that speak IP might not even need to speak to hosts on the Internet at all, and if the network is isolated from the Internet, IP addresses can be assigned however the network operator feels is most practical. However, for networks that need to be connected to other networks (which is, well, the point of the Internet), picking an address at random without coordination would not work. The thing is, it turned out that many leaf site hosts benefit from IP but don't really need to be connected directly to the Internet. Especially in situations where IP address space was scarce, this was a very useful use case to allow for. Hence, specific IP ranges were set aside for use on "private Internets". This was one of the things that made network address translation a practically usable technique for further conservation of IP address space, but NAT is not the only way of bridging such hosts onto the Internet (proxy servers being another).

A "private Internet" can easily span multiple locations, or otherwise require subnetting and routing. The home network case of a single subnet with a few hosts, connected through a single gateway to a larger network, is the trivial case. My own home network consists of two logically and electrically separate networks, each on its own subnet, with limited routing between the two. If I connect to my workplace's network over a VPN link, then some degree of traffic flow can happen in both directions, but the networks remain separate. Two large datacenters could be connected over a VPN link without using globally routable addresses for anything more than the VPN concentrators at each end of the VPN link itself.

Using private IP addresses means that at most, I need to coordinate with my employer to ensure that they don't use the same IP addresses on their network as I do on mine at home, or the administrators working on each datacenter need to coordinate with each other to ensure their IP assignments don't collide. Using private IP addresses also means that I don't need to concern myself with what physical network hardware are in use at the other end of the Internet link; I only need to concern myself with the fact that both ends speak IP, and that both ends use different IP address allocations (to avoid conflicts).

All of this is some of the reasons why private IP addresses are used in lieu of hardware addresses such as MAC addresses.

Another thing I don't understand completely is the private ip classes, A B and C. What is the difference between these?

Classful IP addressing has been deprecated since 1993, when Classless Inter-Domain Routing (CIDR) was introduced.

The "A", "B" and "C" IP address classes were subdivisions of the IP address space, where the initial few bits of the IP address determined the length of the network identifier in the address. It probably seemed like a good idea in 1981, but the way this was done turned out to be hugely wasteful in practice as the Internet grew. Keep in mind that 1993 was well before commodity Internet access became reasonably commonplace outside of the purely academic sector; in many countries, that happened around 1995-1996 or so.

These days, any networking textbook that talks about "class A", "class B", "class C" and so on IP space should be thrown out immediately. It's about as relevant to modern networking as a book describing how to maintain your Ford Model T is to a present-day racecar mechanic. In some colloquial speech, "class A", "B" and "C" are used to refer to CIDR netmask lengths of 8, 16 and 24 bits, corresponding to the initial network portion lengths of those IP addresses, without having anything to do with where in the IP address space those networks reside, but this is not what IP address classes were.

1

MAC addresses are used at layer 2 to let machines on the same local network communicate with each other using Ethernet packets. IP addresses are the next layer up, layer 3, and allow machines to exchange IP packets with each other, which unlike Ethernet packets can be routed between different networks.

IP subnet classes A, B and C no longer exist, having been replaced by CIDR variable-size subnets. When they did exist, the only difference between them was their size -- they had either 254 (class C), 65,534 (class B) or 16,777,214 (class A) usable IP addresses (assuming they were configured as a single big subnet, which classes A and B certainly would not be in practice).

1
1

MAC addresses VS private IP:

the most important thing about IPs is that they are able to be routed. A network (even private one) isn't always have one subnet. which means it isn't just one part and for some reasons (better management for example) we split it to some subnets. now you suppose we have a network that has two subnets like below:

enter image description here

suppose the router has another interface and is connected to network B. a packet is received from network B. now how should the router find the destination?

in the scenario which we don't have IPs, we should have a table for all of MAC addresses like which we have in switches, but in the scenario which we have private IPs, router chooses the path by just looking at the destination subnet.

about IP classes:

nowadays the important difference between them is just the number of IPs which are in them.

1
  • You write of IP "they are able to be routed" <-- yes, though bear in mind the poor terminology , where private IP addresses are referred to as non-routable, by which is meant, not routable on the internet
    – barlop
    Aug 13, 2015 at 17:21
1

Private Network Addressing exists to prevent IPv4 exhaustion, this system allow a home/office/enterprise local area network to have an standardized in the RFC 1918 private addressing method and cover all their needs. IPv6 was developed to address this problem, anyway ipv4 will be completely exhausted in a short period of time.

To solve the inconvenience about communication between Public Addressing and Private one exist Network Address Translation.

About Full Class networks, they were replaced by classless inter domain routing which provides a more flexible method. We could surf deep in this topic but I think that to have a better knowledge of the subject you should read THIS.

0

One important aspect of IP addressing is that even in a small home network where you might have no need for multiple, routed networks you are nearly always connected to an outside IP network (i.e. your ISP). So you need Layer 3 networking.

For local traffic, you would not need L3 routing but it would be cumbersome to only communicate on L2: DNS for instance is on L3. The helper protocol between L2 and L3 is ARP.

0

I'm trying to get a head start before my A level and one thing I couldn't quite understand was why local ip addresses are used.

Networking is a huge complex subject.

Try and make sense of the book.

What book are you using, and what does the book say?

Quote it.

By local IPs, I don't think your book would've called them that, did it?

Maybe you mean Private IPs.

You can look up what a private IP is and then say what it is about it that you don't understand.

The issue really though is how deep your syllabus explains it.

You can always read a load of explanations on the internet, and it looks like you haven't really, you've just conjured up some "understanding" without stating/quoting any sources. Maybe you can quote the sources and we can see if the sources are correct or if you are misunderstanding them.

My current understanding is that mac addresses are used amongst local networks to send data.

Used can mean anything. I have absolutely no idea what you mean. You're not saying much.

Any address, MAC or IP, is used to send info. Like if on a street, if house A wanted to send a letter to house B, that's what house B's address is for.

And public ip addresses are outside of LANs. Local ips are used within LAN's only so why are they needed if mac addresses do this aswell?

That's a good question. And at home when you just have one router then technically you could just use MAC addresses for communication between computers on the LAN. If there was a protocol that didn't touch IP.. though i'm not sure there is one in practice. Even ARP which is considered Layer 2.5 still includes an IP address.

And the way protocols are written e.g. HTTP, it relies on IP and MAC.

It's additional complexity in order to deal with situations where the computers aren't just communicating with each other all behind one router.

Another thing I don't understand completely is the private ip classes, A B and C. What is the difference between these?

Classes haven't been used for like 20 years+. And i'll show you it's outdated for over 20 years. They were basically a bad idea. It was replaced with CIDR. I notice this document on CIDR(Classless..) is from 1993 https://www.rfc-editor.org/rfc/rfc1519
And RFC 1918 which is from 1996 says "Note that (in pre-CIDR notation) the first block is nothing but a single class A" So since 1993 classful addressing has not been used.. And and we haven't had classes of IP address. For some reason some networking books don't tell people that.

And the hilarious thing is that 15 years ago, when I did it, (And btw I had a dozen books or more, (as I was obsessed)), I read them all, and none of them mentioned classful or classless addressing. You're suggesting that now they're mentioning classful addressing.

(though people that study modern networking exams like cisco often still learn them and get called out on their ignorance). Classful addresses are categories/labels for ranges of IP addresses with specific subnet masks depending on the range. Really Networking is a huge subject.. I don't know what the syllabus expects from you.

I aced A level Computing back in my day.. books were Heathcote and Ray Bradley and CS French. It wasn't easy, they had an IT portion that was airy fairy, and a technical section.. and there was a coursework that involved programming. And the exam might've had algorithms..cpu architecture, databases. We didn't have networking in it.. I don't know what level they expect. When I answered the exam questions and different books had conflicting definitions, I wrote in my answer what page number I was getting the info from. And that was without a book in front of me, so you can at least do that with the book in your house and reachable.

If you were more academic then you'd have quoted the sources for where you got your understanding, and you'd have different books.

You could edit your question and improve it by quoting your sources, then I could respond further.

Not the answer you're looking for? Browse other questions tagged .