IP Addressing (IP Protocol)

In one word, IP addresses "route". IP Packets do this by Packet Switching using Routing Tables. The Internet tends to use this protocol to learn about the cloud that represents the network. This protocol generates this Routing Table.

To calculate the routing table:

IP Header

Pasted image 20250123153514.png

Here are some honorable mentions of what the bits mean:

IPv4

IPv6

We've already run out of IPv4 addresses, so now companies have to ask other companies for their addresses.
This is one reason why we are moving to IPv6.

Some properties about IPv4 address properties:

IPv4 numbers are organized by the Internet Assigned Numbers Authority. There's 5 regional registries:

Pasted image 20250123160833.png

which organizes the global IP addresses (ie: the top bytes).

The IP address is broken into two parts:

An Example of Hierarchical Network Addressing (used in IPv6)

The worry back in the day (and even now) is having too large of a Routing Table on the Internet. Each lookup requires a hash function operation, which over time adds up.

Say we're AT&T and this is our internet (as an ISP):

Drawing canvas

But what happens if we want to have different devices in a hierarchical fashion? If we have 4 children from our starting router, then we add 2 more identifier bits:

Drawing canvas

This process continues. Notice the /n notation, which dictates the subnet mask (ie: how many bits, from left to right, are valid and have to match).

Drawing canvas

This is called address agregation. When we route, we take note of which IP address subnets are in which directions:

Drawing canvas
Reflect

Note that nowadays, because the top half of bits are given out, Cal Poly (and anyone with those higher bits) have way too many IP devices that they have to dole out. This is why this is moving into IPv6, and we are trying to put this into effect after the fact.

"The only way to know the slash is to ask" - Prof. Smith

Examples

Given 77.195.10.20/10, what is the network part of the mask?

Here you can also just and the given subnet mask with the actual IP address:

77      .195     .10      .20         (Decimal Address)
01001101.11000011.00001010.00010100   (IP)
11111111.11000000.00000000.00000000   (Subnet Mask)
-----------------------------------
01001101.11000000.00000000.00000000
77      .192     .0       .0

Given someone has a 130.170.168.159/18 subnet mask, if they want to give out a 2nd tier netmask with /22 then:

Given a subnet mask of /25 using this 2nd tier subnet mask then:

A lot of devices don't know where to put the /n part of the subnet, so instead they use the dot decimal format, where the mask is actually given as a decimal number:

11111111.11111111.11111111.10000000/25 (Subnet Mask)
255     .255     .255     .128         (Dot Decimal)
Midterm

You'll need to be able to actually break out the bits of just the host. For example, for the IP address 130.170.168.159/25 then:

  • The host is 0.0.0.31
  • It's on the 130.170.168.128/25 subnet
    You have to say it like this, since really you are saying what your IP is (and that's a redundant question).

For the number of hosts, just look at the remaining bits for the host, and subtract 2. For example, on 65.33.18.10/26 then we have:

Site Local Addresses

Some addresses are site local, for example 192.168.0.0, which never leave your house. Essentially, the Wireless Router you have only has outgoing IP information, so then your router can be treated as a device, and just coagulate all the outgoing requests and handle it.

Drawing canvas

Note that localhost, or 127.0.0.1 is the same machine as yourself.

Classfull IP Addresses

This is an older addressing scheme, where they were broken up into 3 classes (rather than our subnet divisions):

  1. /8: Class A
  2. /16: Class B
  3. /24: Class C

So you couldn't be an ISP and only offer /22 subnets. The issue with this is that then people initially were able to have a ridiculous amount of hosts.

MIT for example had a Class A, and thus had 2242 hosts, which is huge! Remember that networks initially were a university endeavor, so the universities doing research got juicier subnets. Cal Poly got a /16 so then they got considerably less, but still more than enough.

Having a class C is much more sustainable for say a college, since then there's likely going to be enough router traffic that it can handle all the traffic for new devices.

Pasted image 20250128162641.png

Routing Table Considerations

You would think that the Routing Table can be quite small, but over time there has been a sigmoid increase in table:

Pasted image 20250128162809.png

(note: these are for the core routers handled via ISPs)