Internet (IP) Addresses

pigeoneggtrainsΔίκτυα και Επικοινωνίες

24 Οκτ 2013 (πριν από 4 χρόνια και 18 μέρες)

85 εμφανίσεις

Internet (IP) Addresses

Naming every interface!

Naming


Naming every
interface

in the world is not easy


Networks evolved from vendors with
DIFFERENT naming schemes.


Use the same scheme compilers use to solve the
one language …

many processors
issue


compilers translate one language
-
> specific CPU/OS


translate from universal machine address to vendor
specific machine address


IP addresses are that universal naming scheme



What does an IP address look like?


Internet agency responsible for allocation


4 byte value (0..255 for each value


e.g. 137.155.2.10


first byte determines what KIND of address


Class A:

0
-
127


2
7

Class As


Class B:

128
-
191

2
14

Class Bs


Class C:

192
-
223

2
21

Class Cs


Others have reserved use

Examples

137.155.2.10


Class B


47.75.2.1


Class A


204.10.1.4


Class C

Interpreting the Address

Think of the address as having 2 parts:

NETWORK

:
HOST

Which network?

Which specific

interface on that

network

137.155
.
2.10

Class

#BytesNet

#Nets

#BytesHost

#Host



A 1 128



3


17x10
6


B 2 16,000


2


65x10
3



C 3 2x10
6



1


256

137.155
.2.10


Class B


47
.
75.2.1


Class A


204.10.1
.4


Class C

EXAMPLES

Any address in the internet can immediately be classified in that

manner to determine which network and which host.

Some “networks” are too big, so subnetting is used.

Subnet Configuration

ORIGINALLY:


Network:Host


With SUBNETTING:


Network:Subnet:Host

Subnets


The “internet” is not aware of subnets


Doesn’t care!


Internal configuration within an IP network.


Used for further segmentation


performance


security


as before with bridges

What does the “outside” internet do?


Only examine standard Class A/B/C designation
to determine network (first number)


Route all messages in the network to the same
destination

What does the “inside” internet do?


Use internal (extra) info to determine subnetting


Has the freedom to manage the addresses with
additional flexibility

Subnet Masks

So exactly how does the subnet
concept work


First define what a mask is.


Apply the mask to determine what subnet
the address is on.


Use that to determine how to route the
message (later)

Masks

a means of selecting bits

Lots of examples of this.


One is determining Class A from Class B and Class C addresses.


0
xxxxxxx
-
> These value are all less than 128 (0
-
127).

10
xxxxxx
-
> These values are between 128
-
191.

110
xxxxx
-
> These values are between 192
-
223.

A mask will enable one to select specific bits. In this example

It will enable determination of a class A/B/C address.

Background .. Logical
and

Consider a BITWISE
and

operation:

1

1

0

0


0
1

1

0

---------

0
1

0

0

Consider a slightly different view:

1
1 0

0

0

1 1

0

---------

0
1 0

0

Mask

Value

Ones let the value through

Zeros stop the value

How do masks work?

Define a mask to select the bits you want.

Then
and

the mask with the value.

To determine if Class C, the mask would be 1 1 1 0 0 0 0 0.

1 1 0 0 0 0 1 1

1 1 1 0 0 0 0 0

-----------------

1 1 0 0 0 0 0 0

( 195)

Mask

192

Yes this is Class C

1 0 0 0 0 0 1 0

1 1 1 0 0 0 0 0

-----------------

1 0 0 0 0 0 0 0

Mask

128

( 130)

No.. this is Class B

So how does this impact setting
up a subnet?


The fundamental question is how does one
determine to which subnet an address
belongs.


Apply the subnet mask to the address and
what is left indicates which subnet the
address indicates.

Example

Typical class B mask:

255.255.255.0


255 . 255 . 255 . 0

11111111.11111111.11111111.00000000

Typical class B address:

137.155.2.20


137 . 155 . 2 . 20

10001001.10011011.00000010.00010100

Apply the mask

11111111.11111111.11111111
.00000000

10001001.10011011.00000010
.
00010100

10001001.10011011.00000010
.
00000000

137.155.2
.
20

137.155.2
.
0

Result
-
> Given the IP address, this calculates the


corresponding subnet address.

This 255.255.255.0 mask is a
typical

Class B subnet approach.

It’s NOT the only one.

Now what?


Now we can answer the question:

“What subnet is this address on?”


This will be a fundamental element of routing


Recall that subnet masks are only used internal to
the address (inside CNU)


Used to allow flexibility for internal routing
configurations


Not relevant outside the network


outside 137.155.2.x for CNU