6 - Finishing IP Addressing

For program 2 make sure you are doing the following:

while(server is not down)
{
	printf("$:");
	flush(stdout);
	// do poll(), using processServer() like in the mini-program
}

Also the next lab period is on zoom, and we'll be just going over and grading the mini-program.

Continuing addressing from last time:

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):

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:

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).

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

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?

  • Answer: It's 77.192.0.0 because we get 8 bits from the 77 part, then the top two bits of 195 === 11000011 giving us 192. We may write this as 77.192.0.0/10 or 77.192/10
    Given 44.89.130.89/20, what is the network part of the mask?
  • Answer: It's 44.89.128/20 getting the higher 4 bits from 130

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:

  • They can have 16 2nd tier networks
  • The IP address above becomes on the 2nd tier subnet 130.170.168.0/22

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

  • There's 8 3rd tier subnets possible
  • The subnet part would be 130.170.168.128/25

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:

  • 232262=262=62 hosts
    The reason is that we have 2 invalid addresses this way, all 0's and all 1's. Thus we get rid of them.